validation/hidden fields question

wxdqz

New Member
I have two forms with identical information that call the same javascript function. One form is for adding information and has 4 fields that are hidden and then other is for editing information and has those fields displayed in text fields. If I use the same javascript functions, will this if statement evaluate both the fields the same:
if (document.update.firstname.value.length == 0) {
alert ("Please enter the FIRSTNAME.");
document.update.firstname.focus();
return false;
}
The HTML:
<input type="hidden" name="firstname" value=http://www.webdeveloper.com/forum/archive/index.php/"<?=$_POST['firstname']?>">and <input type="text" name="firstname" size="25" value=http://www.webdeveloper.com/forum/archive/index.php/"<?=$rowS['firstname']?>">In the add script, there will be a value in firstname because I'm putting it there. In the edit script, it is being read in from the database, but the user could clear the form and thus blank out that field. So I guess what I'm asking is:
Will this javascript test bomb on the add (hidden field) script?
 
Back
Top