close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem with PHP if when using ValidatedField data?

Thread began 10/23/2017 1:51 pm by Nathon Jones Web Design | Last modified 10/24/2017 9:48 am by Ray Borduin | 778 views | 2 replies |

Nathon Jones Web Design

Problem with PHP if when using ValidatedField data?

I have an UPDATE form that displays content if a value from the recordset, for the row that's being updated, is a certain numeric value:

<?php if ($rsEDITNEWS->getColumnVal("NJnewsFILE1TYPE") == 1) { ?>
<i class="fa fa-file-pdf-o fa-3x pull-left" aria-hidden="true" style="margin: 0 10px 10px 0;"></i>
<?php } ?>



This works fine upon initial opening of the update page but when the form is submitted and it fails WA Server validation the content is no longer displayed.

So I tried changing it to this, assuming that I'd need to check the ValidatedField data because it was being submitted and then failing:

<?php if (isset($_GET['enewsval'])?ValidatedField("editnews_784","newsFILE1TYPE"):$rsEDITNEWS->getColumnVal("NJnewsFILE1TYPE") == 1) { ?>
<i class="fa fa-file-pdf-o fa-3x pull-left" aria-hidden="true" style="margin: 0 10px 10px 0;"></i>
<?php } ?>



"newsFILE1TYPE" is the name of the form field that is being submitted.
Why isn't this working and/or what am I doing wrong?

Thank you,
NJ

Sign in to reply to this post

Ray BorduinWebAssist

The issue is probably because of the way the parenthesis line up. It should probably be:

<?php if ((isset($_GET['enewsval'])?ValidatedField("editnews_784","newsFILE1TYPE"):$rsEDITNEWS->getColumnVal("NJnewsFILE1TYPE")) == 1) { ?>

Sign in to reply to this post
Did this help? Tips are appreciated...

Nathon Jones Web Design

Thank you Ray.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...