Form submision probs with Javascript and PHP

From: Date: Fri, 09 Feb 2001 22:36:25 +0000
Subject: Form submision probs with Javascript and PHP
Groups: php.general 
Request: Send a blank email to php-general+get-39027@lists.php.net to get a copy of this message
Here's my script. This is a known working script when I use ASP. Why won't is wotj with PHP. function submitForm(f, strPage) { errormsg = ""; if (f.login.value.length == 0) { errormsg = errormsg + "Please enter a login name.\n"; } if (f.email.value.search("@") == -1 || f.email.value.search("[.*]") == -1) { errormsg = errormsg + "Please enter a valid email address."; } if (errormsg != ""){ alert(errormsg); } else { f.action = strPage; f.method = "post"; f.submit(); } } Here's the button. <input type="button" name="submit" value="Add User" onClick="submitForm(this.form, 'adduser-do.php')" style="width=150;"> Any help would be great. Thanks, Pat

« previous php.general (#39027) next »