Jump to content

Form validation with 2 actions if error or not


Eggzorcist

Recommended Posts

I'm wondering wether it's possible that if there is an error as in if $error isset, it will stay on this page displaying the error otherwise, it will go to the destined action='register.php' is this possible?

 

if so, how would i be doing this?

 

Thanks a bunch!

Link to comment
Share on other sites

Well, is there a way to create a regex style validation? So basically if I already have

 

 if (!preg_match("/\A[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/", $email)){
	$Error .= "Email Address Must Be In format: [username]@[domain].[extension] <br />";
}

 

is there a javascript way of doing this? My javascript is pretty bad :P

Link to comment
Share on other sites

Yes, I do. However, this needs to be in javascript to be able to use the onSubmit html function, because I'm trying to use the validation before the action which leads off to another file. Is there a way to implement the php regex prior the action(register.php) file?

 

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.