Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CheckBox Validation

Status
Not open for further replies.

nainil

IS-IT--Management
Jun 18, 2005
6
US
Hi,

I have 2 checkboxes. One is a Yes, the Other one is a No.
I need to a function which at anygiven point of time allows me to select only one of them. So when I click on Yes the No should be un-checked and vice versa.

Can anyone help me with this.
Thank you.

Nainil Chheda.
 
Hi,

I don't want to use a radio button. Coz, when I'd print the form it won't look good showing a radio button. A check box still looks decent.

Thank you.
Nainil Chheda.
 
<form name=TheFrm>
<input type='checkbox' name='Chk1'

onclick='this.checked==true?document.TheFrm.Chk2.checked=false:""'> 1
<input type='checkbox' name='Chk2'

onclick='this.checked==true?document.TheFrm.Chk1.checked=false:""'> 2
</form>

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top