[Javascript] getting form fields by name

greg at krieser.com greg at krieser.com
Tue Oct 22 09:59:08 CDT 2002


Here is a great resource for you to do what you are trying to do:

http://www.xs4all.nl/~ppk/js/

Select Forms, the Introduction to forms.  Scroll down to the check box area.

Greg

The following message was sent by "Alastair Moore" <alastair at alastairmoore.co.uk> on Mon, 21 Oct 2002 13:54:32 +0100.

> Hi all,
> 
> I have a form such as below -
> 
> <form action="" method="post" name="createevent">
> <input type="checkbox" name="culture_all" value="culture_chk"
> onClick="checkBoxes(this.form, this.checked, this.value)">Culture Vultures
> <input type="checkbox" name="culture_chk" value="18">jo
> <input type="checkbox" name="culture_chk" value="26">Bill
> <input type="checkbox" name="culture_chk" value="28">Alf
> <input type="checkbox" name="sporty_all" value="sporty_chk"
> onClick="checkBoxes(this.form, this.checked, this.value)">Sporty Types
> <input type="checkbox" name="sporty_chk" value="25">Luke
> <input type="checkbox" name="party_all" value="party_chk"
> onClick="checkBoxes(this.form, this.checked, this.value)" disabled>Party
> Animals
> <b>No friends in this category</b>
> <input type="checkbox" name="others_all" value="other_chk"
> onClick="checkBoxes(this.form, this.checked, this.value)" disabled>Others
> <b>No friends in this category</b>
> </form>
> 
> What I'm trying to do is check if all the "culture_chk" checkboxes have 
> been
> checked and if so check the culture_all check box. Should a user unclick 
> one
> of the culture_chk checkboxes, the culture_all checkbox will not be checked.
> Does anyone have any suggestions how this can be done?
> 
> Thanks!
> 
> Welly
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 



More information about the Javascript mailing list