[Javascript] Need some help validating a form

Peter Brunone peter at brunone.com
Wed Apr 18 12:58:15 CDT 2007


Hi Jim,

    I assume you're doing some kind of loop through the form elements, perhaps with an array provided by document.getElementsByTagName("INPUT").  If that's the case, you could either (a) use the name or ID attribute to identify the type of element, or (b) check the .type property of each element to see if the type is "text" or something else.

    If that doesn't help, feel free to post the code that you're using.

Cheers,

Peter

----------------------------------------

From: "James Macdiarmid" James.Macdiarmid at cgifederal.com

I have an application that keeps track of keywords. On the page I have 2
forms. One called frmEditKeywords and the other frmAddKeywords. The
frmEditKeywords calls the ValidateEditKeywords function on submit.The
frmEditKeywords has a couple control arrays such as a Textbox array, a
Dropdown Select box array, and a checkbox array.

Is there a way to only validate the textboxes on submit rather than
doing the whole form? Now I can't make updates using the dropdowns or
the checkboxes. It goes through the textbox validation first.

Hopefully the way I described this is understandable. Let me know if
it's not clear. 

Thank you in advance,
Jim 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20070418/8fc417d3/attachment.htm>


More information about the Javascript mailing list