CheckBox problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathewgk80
    New Member
    • Sep 2007
    • 103

    CheckBox problem

    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.
  • zaphod42
    New Member
    • Oct 2008
    • 55

    #2
    I'm going to call them chkFriend, chkFam, etc...

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

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

    Code:
    function chckChecks(el){
        if(el.checked){
            document.getElementById('chkFriend').checked=false
            document.getElementById('chkFam').checked=false
        }
    }
    you could make this differently, and more flexible, but without seeing your code, this seems to be what you're asking for...

    Comment

    Working...