471,605 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Validating Html form

Hi, i just want to know do u validate a form.

Ok, i just want to make sure that the user doesnt skip a textbox(fname), don't enter text in lets say 'zipCode' textbox. I am not trying to validate data against xlm file(am not onthat level yet!).

Expand|Select|Wrap|Line Numbers
  1. <p>
  2.             First Name&nbsp;&nbsp; &nbsp; 
  3.             <input id="firstName" style="WIDTH: 233px; HEIGHT: 23px" type="text" size="31" name="firstName" />  </p>
  4.  
  5. <input style="WIDTH: 92px; HEIGHT: 22px" type="text" size="12" name="zip" />
  6.  
Oct 23 '07 #1
1 1170
numberwhun
3,503 Expert Mod 2GB
Hi, i just want to know do u validate a form.

Ok, i just want to make sure that the user doesnt skip a textbox(fname), don't enter text in lets say 'zipCode' textbox. I am not trying to validate data against xlm file(am not onthat level yet!).

Expand|Select|Wrap|Line Numbers
  1. <p>
  2.             First Name&nbsp;&nbsp; &nbsp; 
  3.             <input id="firstName" style="WIDTH: 233px; HEIGHT: 23px" type="text" size="31" name="firstName" />  </p>
  4.  
  5. <input style="WIDTH: 92px; HEIGHT: 22px" type="text" size="12" name="zip" />
  6.  
Unfortunately there is not way to do this with HTML itself. What you are going to have to do is verify, using whatever script this form is being submitted to, that each required field is not null. You can do this with Perl, PHP, etc.

Regards,

Jeff
Oct 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.