[Javascript] Checkbox validation

diego nunes dnunes at gmail.com
Wed Jan 4 09:58:01 CST 2006


On 04/01/06, Cutter (JS) <java.script at seacrets.com> wrote:
> This works great if
> there are multiple files (which, in turn, means more than one checkbox),
> but doesn't work properly when there is only one file (and one
> checkbox)?

    When you have just one checkbox, accessing the
"document.forms['formname'].elements['checkboxname'], you'll get an
object, instead of a array. Try this...

(...)
   if (!fldObj.FieldName.length) { fldObj.FieldName=[fldObj.FieldName]; }
   for (counter = 0; counter < fldObj.FieldName.length; counter++){
(...)

--
diego nunes



More information about the Javascript mailing list