homepage Welcome to WebmasterWorld Guest from 54.198.130.203
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Form validation
problems after validation
Andrew Thomas




msg:1472373
 8:13 pm on Mar 2, 2003 (gmt 0)

Im using yaromat form validator within dreamweaver MX, The validation side works, but once I click OK to the error message (eg "Please enter your email address") Im able to leave this blank and click the send button. Is there a way I can freeze the send button until something has been entered into the email text field?

 

wruk999




msg:1472374
 8:36 pm on Mar 2, 2003 (gmt 0)

Hi Andrew,

Why not use a Javascript validator?
It will be much easier and works a treat.

function Form_Validator(theForm)
{
if (theForm.realname.value == "")
{
alert("Please enter a value for the \"Name\" field.");
theForm.realname.focus();
return (false);
}
}

add this into the action line:
<form method="post" action="/cgi-bin/yourscript.pl" name="theForm" onSubmit="return Form_Validator(theForm)">

Never had experience of what you are using..but this will NOT allow a user to submit if the required fields are blank..everytime they do they just get an error box back! Sweet!

HTH,
William

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved