Page 1 of 1
Form Validation
Posted: Sun Jun 06, 2004 2:00 pm
by Pyrite
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?
Posted: Mon Jun 07, 2004 12:49 am
by scorphus
Check this page
http://devedge.netscape.com/library/man ... ml#1193375 for detailed information.
-- Scorphus.
Posted: Mon Jun 07, 2004 12:55 am
by feyd
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..
Posted: Mon Jun 07, 2004 1:48 pm
by Pyrite
See feyd knows what I'm after... thanks for the tip, I'll start writting it soon.