Results 1 to 2 of 2


  1. #1
    Awful Kinawful Guest

    Default URGENT PLEASE HELP!!!!

    I have a form and not all of the fields are required. However, in some cases, if you fill in one of the unrequired fields, there are other fields that would be required because you filled in that particular field. Make sense?? How do I accomplish this?? As it stands right now, I am using an If IsEmpty statement. Thanks in advance for your help!!<BR>-Awful

  2. #2
    Join Date
    Dec 1969

    Default RE: URGENT PLEASE HELP!!!!

    You could use a javascript function to verify the form before u submit.. so when ur form it submited, it goes to the function and it checks and then submits the function. <BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062;<BR>&#060;!--<BR>function validateFields(){<BR> password1 = document.form.pw1.value;<BR> password2 = document.form.pw2.value;<BR><BR> if (password1 == "") {<BR> alert ("Please fill in a password before you proceed..")<BR> document.form.pw1.focus();<BR> return false;<BR> }<BR> if (password1 == password2) {<BR> if (password1 != "") {<BR> document.form.pw1.value = password1;<BR> }<BR> }else {<BR> alert("Your first password does not match the second..")<BR> document.form.pw1.focus();<BR> return false;<BR> }<BR><BR> if (document.form.username.value == "") {<BR> alert ("you must enter a user name to proceed..");<BR> document.form.username.focus();<BR> return false;<BR> }else if (document.form.firstname.value == "") {<BR> alert ("You must enter your First Name to proceed..");<BR> document.form.firstname.focus();<BR> return false;<BR> }else if (document.form.lastname.value == "") {<BR> alert ("You must enter your last name to proceed..");<BR> document.form.lastname.focus();<BR> return false;<BR> }else if (document.form.email.value == "") {<BR> alert ("you must enter your E-Mail address to proceed..");<BR> document.form.email.focus();<BR> return false;<BR> }<BR> <BR> <BR><BR> document.form.submit();<BR> return true;<BR><BR>}<BR><BR>// --&#062;<BR>&#060;/SCRIPT&#062;<BR><BR><BR>and your form would be something like this<BR><BR>&#060;form.......&#062;<BR>whatever fields.. and<BR>&#060;INPUT TYPE="button" VALUE="Login" onclick="validateFields()"&#062;<BR> <BR>&#060;/form&#062;<BR><BR><BR>hope this helps<BR><BR>Pixel<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts