Jump to content

Form Wont Send


wommbatt

Recommended Posts

i just got my form working the way i want, but for w/e reason after i hit submit it wont send, it merely does my form validation and then stops and reselects the password field

<head><script type="text/javascript">function validate_required(field,alerttxt){	with (field)  	{  		if (value==null||value=="")    	{    		alert(alerttxt);return false;    	}  		else    	{    		return true;    	}  	}}function validate_form(thisform){with (thisform)  {   	if (validate_required(email,"Please enter your email.")==false)  		{  			email.focus();  		}   else (validate_required(password,"Please enter a password.")==false)   		{   			password.focus();   		}  	return false;  }}</script></head>

in the form action itself ive got the action linked to a cgi file where it should b routed to an email address, but as far as i can tell, its not sendingany suggestions?

Link to comment
Share on other sites

Your validate_form function has two problems I think.1. The last line of your with {} block causes it to return false, every time, no matter what. This halts the submission, and that's the big problem.2. else (validate_required . . . I think this was supposed to be else if

Link to comment
Share on other sites

Your validate_form function has two problems I think.1. The last line of your with {} block causes it to return false, every time, no matter what. This halts the submission, and that's the big problem.2. else (validate_required . . . I think this was supposed to be else if
ok, din no that, ill give it a shot ty 8]
Link to comment
Share on other sites

ok, i changed it to else if and it works out pretty well, now ive got another issuewhen the last line sez return false, the script will stop after one of the first 2 if's conditions r met, which is what i wanthowever, if neither condition is met, it still wont send the form on to the cgi file that its linked toif the line instead is return true, it will send it on to the cgi, but it will do this even if one of the if conditions r metideas?i wish i understood this better

Link to comment
Share on other sites

Changing the statement causes the block to return true, every time, no matter what. True or false is not the answer, because the statement is not in the correct place. You might actually need two statements that return false.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...