Dee Dee - 2 years ago 88
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 Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download