Jump to content
xisto Community
Sign in to follow this  
dark

How Do You Validate Your Forms?

Recommended Posts

HiDo you validate your forms using PHP , javascript or both?I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate.ThanksPatrick

Share this post


Link to post
Share on other sites

validate the forms? I did not understand, but I use PHP:for <input name="name">:if(!$name){print "You can't let the input "name" in blank.";exit;}for long forms:if(!$name || !$email || !$age){print "You can't let any input in blank.";exit;}

Share this post


Link to post
Share on other sites

Hi

 

Do you validate your forms using PHP , javascript or both?

I was just playing around with a tutorial for a very simple guestbook and the creator did use both javascript and php to validate.

 

Thanks

 

Patrick

<{POST_SNAPBACK}>


I'd prefer using both of them.

the form data needn't to be send by using javascript

Share this post


Link to post
Share on other sites

if php is available, it is the best method to evaluate forms. This is because some people have javascript disabled. If you use javascript, your form will not work in this case. Using php means the server does the work.Plus, php is very simple. Just a bunch of IF statements and you are done. All my forms are done in php and I don't even have to use a seperate file. Just need an IF (!submit) {display form} ELSE {validate form}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.