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

Checkbox problem

P: n/a
I have a form with 6 checkboxes.

If the user clicks the first checkbox I want the other five to be
automatically checked.

I am aware of form checkbox properties "parent, sibling and child" and
suspect that the answer lies therin but have not been able to google my way
to a website with adequate instrictions on how to use these. Gratefull for
any help. Thanks

Garry Jones
Sweden
Oct 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Garry Jones wrote:
I have a form with 6 checkboxes.

If the user clicks the first checkbox I want the other five to be
automatically checked.

I am aware of form checkbox properties "parent, sibling and child"
Your awareness is flawed. There's no such thing.
and
suspect that the answer lies therin but have not been able to google my way
to a website with adequate instrictions on how to use these. Gratefull for
any help. Thanks
You have to use Javascript, and you should also take into account the
possibility that your users may not have Javascript turned on.

Oct 3 '06 #2

P: n/a

for instance:

function cbxer(name)
{
if(name == \"dryfly\" &&
document.forms[0]['dryfly'].checked)
{
document.forms[0].wetfly.checked=false;
document.forms[0].larvae.checked=false;
document.forms[0].pupae.checked=false;
document.forms[0].streamer.checked=false;
document.forms[0].beadhead.checked=false;
document.forms[0].nymph.checked=false;
}
......etc
}

Oct 3 '06 #3

P: n/a
Garry Jones said
>"I am aware of form checkbox properties "parent, sibling and child"
"Harlan Messinger" replied
Your awareness is flawed. There's no such thing.
Thanks for letting me know that this. I tested a lot with the "parent,
sibling and child properties" listed at Microsoft for "input type=checkbox"

Such properties are listed
nextSibling
canHaveChildren
offsetParent

at
http://msdn.microsoft.com/library/de..._checkbox.aspa

This is not what I was looking for as you pointed out.

Thanks for your help. By the way as java is not always turned on I fixed it
with a "form before form" solution, the user chooses one of two radio button
on form 1 which implies intention and is then taken to the appropiate
"single check box" or "multi check box" form.

Best Wishes
Garry Jones
Sweden

<hm*******************@comcast.netskrev i meddelandet
news:4o************@individual.net...
Garry Jones wrote:
>I have a form with 6 checkboxes.

If the user clicks the first checkbox I want the other five to be
automatically checked.

>and suspect that the answer lies therin but have not been able to google
my way to a website with adequate instrictions on how to use these.
Gratefull for any help. Thanks

You have to use Javascript, and you should also take into account the
possibility that your users may not have Javascript turned on.

Oct 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.