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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deselecting a radio button.....

Status
Not open for further replies.

jamica

Programmer
Apr 25, 2005
17
GB
any1 any ideas on how to deselect a radio button i have already used the onClick function and want to incorporate it into it.... ie if clicked twice then deslect
 
If you want to be able to deselect, why not use a checkbox instead?

There's little point in modifying the behaviour of radio button to behave just like a checkbox, when you can simply use a checkbox to start with.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
That aside, you'll probably have great difficulty achieving this without storing some sort of state variable / attribute.

If you really must do this with a radio button instead of a checkbox, you'd need to look into this, as simpy using the onclick event and checking the "checked" property would prove fruitless.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top