Javascript: EZiest Way To Ref All Form Fields???

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
justravis
Forum Commoner
Posts: 53
Joined: Mon Dec 16, 2002 3:18 am
Location: San Diego, CA
Contact:

Javascript: EZiest Way To Ref All Form Fields???

Post by justravis »

I want to do something like this to represent all fields:

if(document.form.checkboxes.value='' || document.form.radio.value='' || document.form.text.value='')

Is it possible??? THANK YOU!!!
Unipus
Forum Contributor
Posts: 409
Joined: Tue Aug 26, 2003 2:06 pm
Location: Los Angeles, CA

Post by Unipus »

Not sure what you mean, maybe this, though?

document.forms.getElementsByTagName('*')

although unless it's a very small form, I'd be very careful about using a wildcard like that. You might rather use

document.forms.problem.getElementsByTagName('input')

and so on...
Post Reply