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

CheckBox problem

100+
P: 103
Hi,

I have a checkboxlist with two checkboxes with values "Family" and "Friends".
Also i have another checkbox with text "Public".

I need to get a javascript code which uncheck "Family" and
"Friends" checkboxes(if they are checked) when the "Public" checkbox is cheked.

Please help me..

Thanks and Regards,
Mathew.
Oct 21 '08 #1
Share this Question
Share on Google+
1 Reply


P: 55
I'm going to call them chkFriend, chkFam, etc...

[HTML]<input type="checkbox" name="checkSet" id="chkPub" onClick="chckChecks(this)" />[/HTML]

set the mouseup (or click) event on the public checkbox to call this function:

Expand|Select|Wrap|Line Numbers
  1. function chckChecks(el){
  2.     if(el.checked){
  3.         document.getElementById('chkFriend').checked=false
  4.         document.getElementById('chkFam').checked=false
  5.     }
  6. }
you could make this differently, and more flexible, but without seeing your code, this seems to be what you're asking for...
Oct 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.