>> JavaScript treat multiple checkboxes as an array, but a single
>> checkbox is not an array. A quick goggle didn't turn me a up
>> with an example but there should be plenty of examples out
>> there of checking for this with JS.
>>
>> You can also take what I consider to be an easier way out,
>> using CF to push down a different script depending on how many
>> boxes you are going to have.
>
>That's right! I didn't even notice the single checkbox part of this. If you
>look at the length of the checkbox array and get undefined, you only have
>one checkbox, so there's no need to bother with separate scripts. I think
>this would work for you:
That's one of the nice things about the qForms API--you don't have to worry
about how the DOM works, you just code your rules. For example, if you want
to make sure at least one checkbox is filled in, just do:
oForm = new qForm("viewItems");
oForm.atccNum.required = true;
- or -
oForm = new qForm("viewItems");
oForm.required("atccNum");
The required() method allows you to specify a list of form fields to
require.
If you want to see the value of the checkboxes, just do:
oForm.atccNum.getValue();
The cool thing is, that's the same syntax you use to retrieve the value of
any form field!
More on qForms:
http://www.pengoworks.com/qforms/
-Dan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212468
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54