Form Validation
Moderator: General Moderators
- Pyrite
- Forum Regular
- Posts: 769
- Joined: Tue Sep 23, 2003 11:07 pm
- Location: The Republic of Texas
- Contact:
Form Validation
Is there some kind of javascript form validation where I don't have to specify input names or values and it can just check all input text boxes for example on a page and return their values as ones that werne't filled in using a alert box or something. ? Suggestions?
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
Check this page http://devedge.netscape.com/library/man ... ml#1193375 for detailed information.
-- Scorphus.
-- Scorphus.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
here's how I'd make the function:
get number of fields in the form
iterate through them checking if the value is empty unless it's a radio, checkbox, select, image, or button. In which case, for radios and checkboxes, see if one of the options is 'checked'. For selects, check the value isn't the default (hopefully blank, or the first one always).. images and buttons aren't checked..
I'd add a name check only to exclude the "optional" fields..
get number of fields in the form
iterate through them checking if the value is empty unless it's a radio, checkbox, select, image, or button. In which case, for radios and checkboxes, see if one of the options is 'checked'. For selects, check the value isn't the default (hopefully blank, or the first one always).. images and buttons aren't checked..
I'd add a name check only to exclude the "optional" fields..