close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

red background alert not triggered for email field

Thread began 7/23/2009 12:45 pm by clayjar238880 | Last modified 7/23/2009 5:28 pm by clayjar238880 | 2329 views | 6 replies |

clayjar238880

red background alert not triggered for email field

I have a contactus.php page created using your contact form solution pack. When a user tabs away from each required field without entering anything, in addition to displaying the error message, the backgrounds of the text fields turn red to alert the user, except for the email field. The red warning color does not appear in this field. How do I fix this so the red background color appears in the email field as well when the user tabs past this field without entering email address? thanks so much!

here's the code in contactus.php for the email text box:

<label for="Email_address" >E-mail address:</label>
<br />
<span id="sprytextfield2">
<input name="Email_address" type="text" class="inputValue" id="Email_address" onblur="if (document.getElementById('emailServerError')) document.getElementById('emailServerError').style.display='none'" value="<?php echo(ValidatedField("contact","Email_address")) ?>" />
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
<input name="seconddblock" id="seconddblock" type="text" style="display:none" value="" />
<?php
if (ValidatedField("contact","contact")) {
if ((strpos((",".ValidatedField("contact","contact").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<span id="emailServerError" class="textfieldServerError">Please provide your email addess so we can get back in touch with you.</span>
<?php //WAFV_Conditional contact.php contact(2:)
}
}
}?>

Sign in to reply to this post

Ray BorduinWebAssist

most likely the issue is in the spry javascript lower on the page... find the line that refers to "sprytextfield2" and compare it to the ones that work in the spry script just above the </body> tag.

Sign in to reply to this post

clayjar238880

thanks for the quick response!!!

On further notice, I see that the red background alert works in Safari on my MAC and Explorer on my PC. But it does not work in either FireFox version 2.0.0.20 on PC or FireFox version 3.0.12 on MAC. Is there a way to get it to work in FireFox?

Here is the spry code for the first two text fields. I haven't changed anything yet, since discovering that it seems to be a FireFox issue.

var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]});
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email", {validateOn:["blur"]});

Sign in to reply to this post

clayjar238880

here is a link to the contact form, so you can test it and see what if it is behaving for you as I described it was behaving for me:
contactus.php

Sign in to reply to this post

clayjar238880

I found something that is strange...

The first text field for entering the name has always shown the red background alert correctly. But if I change the label for the first text field to "Full Name:" instead of "Your name:", the red background alert no longer works. And if I change the label back to it's original label "Your name:", the red background DOES work as it did at first.

Still unable to make the email text field red background alert work in firefox and wondering if this cause and reaction (described above concerning changing the label for the name text field) could be a similar issue to what is happening with the email text field not showing it's red background alert, though I have not changed the label for the email field; this label is named as it was originally out-of-the-box.

(???)

Sign in to reply to this post

Ray BorduinWebAssist

I'm really not sure... sounds like an issue with spry of some sort. It appears to work fine with firefox on a PC just to add to the confusion. I'd search spry forums on adobe to see if anyone has run into this problem. It is the first I have heard of it here. It doesn't seem like you are doing anything wrong, so the spry code itself must be failing somehow. Are there any errors in the javascript error console regarding that field? Does it still validate on submit of the form and just not onblur?

Sign in to reply to this post

clayjar238880

I don't see any javascript errors anywhere. And, yes, it does still validate on submit of the form, but not onblur.

maybe I won't worry about it, since the main thing is that the "server" validations are working, and they do appear to be working.

but I am perplexed as to why simply changing the name of the label would cause a different field that previously had the red background alert working, suddenly stop working just because it has a different label. weird.

is there anything else I should do when changing a simple label for a form element, that you know of?

thanks so much for you help!

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