Check if checkbox is checked with jQuery
IDs must be unique in your document, meaning that you shouldn’t do this: Instead, drop the ID, and then select them by name, or by a containing element: And now the jQuery:
IDs must be unique in your document, meaning that you shouldn’t do this: Instead, drop the ID, and then select them by name, or by a containing element: And now the jQuery:
UPDATE: The below answer references the state of things before widespread availability of CSS 3. In modern browsers (including Internet Explorer 9 and later) it is more straightforward to create checkbox replacements with your preferred styling, without using JavaScript. Here are some useful links: Creating Custom Form Checkboxes with Just CSS Easy CSS Checkbox Generator Stuff … Read more
This worked for me: Where isAgeSelected is the id of the control. Also, @karim79’s answer works fine. I am not sure what I missed at the time I tested it. Note, this is answer uses Microsoft Ajax, not jQuery
This worked for me: Where isAgeSelected is the id of the control. Also, @karim79’s answer works fine. I am not sure what I missed at the time I tested it. Note, this is answer uses Microsoft Ajax, not jQuery
Since Bootstrap 3 doesn’t have a style for checkboxes I found a custom made that goes really well with Bootstrap style. Checkboxes Run code snippetExpand snippet Radio Run code snippetExpand snippet Custom icons You can choose your own icon between the ones from Bootstrap or Font Awesome by changing [icon name] with your icon. For example: glyphicon glyphicon-remove for Bootstrap, or fa fa-bullseye for Font Awesome