By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,346 Members | 2,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,346 IT Pros & Developers. It's quick & easy.

formvalidation problem

P: n/a
hello,

i have a form.
it depends on the behaviour of the visitor how many fields the form
contains.

now i must validate the form, but because i don't know if the form contains
5, 10 or whatever amount
of fields, i am not sure how to validate it

does anyone have an idee?

thanks
Jan 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
nescio wrote on 10 jan 2006 in comp.lang.javascript:
i have a form.
it depends on the behaviour of the visitor how many fields the form
contains.

now i must validate the form, but because i don't know if the form
contains 5, 10 or whatever amount
of fields, i am not sure how to validate it

does anyone have an idee?


for (el in document.forms['myForm'].elements)
if (el.type=='input') validateInput(el.value);

Not tested, just the idea as requested.
[idee is Nederlands hoor]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 10 '06 #2

P: n/a
[idee is Nederlands hoor]


yes, ja, indeed, inderdaad :-)
Jan 10 '06 #3

P: n/a
On 2006-01-10, nescio <ne****@nescio.nl> wrote:
hello,

i have a form.
it depends on the behaviour of the visitor how many fields the form
contains.

now i must validate the form, but because i don't know if the form contains
5, 10 or whatever amount
of fields, i am not sure how to validate it

does anyone have an idee?


Use a for loop.

without more details that's the best advice I can offer.

Bye.
Jasen
Jan 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.