Hi!
This is my first attempt at form validation and it's giving me fits. I've tried to copy/paste and modify code from examples around the web, but I can't find any all inclusive code examples, and can't figure out which parts I should change/not change to suit my form. Basically, I'm having trouble following the code. I'm also having trouble figuring out how to call the script when the user clicks the submit button. I'm kind of new to javascript, and my entire site has been in PHP thus far.
My form is named "Oregistration"
it has 5 fields:
fname
lname
nickname
password
email
I would like to validate to make sure the e-mail is in the correct format. Also, I'd like to make sure that all fields are not blank and contain no more than 25 characters. That's all, nothing too strict. If anyone can help point me in the right direction with a code example that would be great. Again, with other code examples I have trouble finding which elements to replace with elements specific to my form. Also, I need to know exactly how to call the validate function when the visitor clicks submit.
Appreciated.
This is my first attempt at form validation and it's giving me fits. I've tried to copy/paste and modify code from examples around the web, but I can't find any all inclusive code examples, and can't figure out which parts I should change/not change to suit my form. Basically, I'm having trouble following the code. I'm also having trouble figuring out how to call the script when the user clicks the submit button. I'm kind of new to javascript, and my entire site has been in PHP thus far.
My form is named "Oregistration"
it has 5 fields:
fname
lname
nickname
password
I would like to validate to make sure the e-mail is in the correct format. Also, I'd like to make sure that all fields are not blank and contain no more than 25 characters. That's all, nothing too strict. If anyone can help point me in the right direction with a code example that would be great. Again, with other code examples I have trouble finding which elements to replace with elements specific to my form. Also, I need to know exactly how to call the validate function when the visitor clicks submit.
Appreciated.
Comment