Dee Dee - 6 months ago 8
Javascript Question

How do I allow to check only one checkbox out of four in UserControl?

I have created a User Control with 4 check boxes(server control). I want to allow to check only one checkbox out of four.

The user control is loaded on page dynamically.I page may have multiple same UserConrol.

How do I do it using jQuery or Javascript?

Answer

Use a Radio Button Control. Checkboxes are meant for multiple selections, whereas Radio Buttons are meant for single selections. Then with the Radio Buttons you can specify the GroupName for those controls to limit the selection to a single item.

Comments