close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Show if

Thread began 12/01/2012 3:54 am by thehalpeen319342 | Last modified 12/03/2012 10:51 am by thehalpeen319342 | 1367 views | 4 replies

thehalpeen319342

Show if

Dear Jason, I’m back at the registration page – just when I thought here were sorted. I’m adding some extra server-side validation – in particular some validation to work on the email field so as to avoid duplications in the database table – so I’m using ‘unique database value’ server validation.

Note: I’ve turned off Javascript in Firefox.

PROBLEM 1
Firstly, in my CSS Form Builder ‘Registration form’, I’ve added an extra ‘show if’ validation for the ‘unique database value’ and that works. I have noticed in the code that it did not add any ‘span or an id’ like in the other show if message for the same filed that CSS Form Builder added – so I need to have a class and an id. I probably need the class for the colour, but what is, and how is, the ‘id’ generated – see code below:
Email Validation code:
<?php
if (ValidatedField('register','register')) {
if ((strpos((",".ValidatedField("register","register").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="Email_Address_ServerError">Please enter email address.</span>
<?php //WAFV_Conditional register.php register(1:)
}
}
}?>
<?php
if (ValidatedField('register','register')) {
if ((strpos((",".ValidatedField("register","register").","), "," . "13" . ",") !== false || "13" == "")) {
if (!(false)) {
?>
Email address already registered!
<?php //WAFV_Conditional register_test.php register(13:)
}
}


In addition, apart from the ‘already registered’ message appearing in black, it is not properly aligned like the ‘please enter an email’ message – screenshots attached.

PROBLEM 2
I was going to add another validation for invalid email entries and have a show if saying (not a valid email) - is this overkill on the validation. Anyway, as things stand, with two validations on this email field, if the field is left bank and I hit submit, all two ‘show if’ messages appear (see attached screenshots), so I imagine if I had another ‘show if’ message, all three would appear. How can this be avoided so that if the field is left blank only the ‘show if’ - please enter an email – appears?

PROBLEM 3
I watched your video ‘Add server validation to your web forms’. I have one question:
Why is the instructor hopping over to the confirm.php page to do the validations. Surely, the validation should be done on the checkout.php page – because that is where the information is entered? The instructor talks about the confirm.php page being the action page and then selects the confirm.php page when she is setting up the show if message, even though the message is on the checkout.php page – I don’t get it.

Attached Files
Show if message.pdf
register.zip

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...