Android checkbox example

In Android, you can use “android.widget.CheckBox” class to render a checkbox. In this tutorial, we show you how to create 3 checkboxes in XML file, and demonstrates the use of listener to check the checkbox state – checked or unchecked. P.S This project is developed in Eclipse 3.7, and tested with Android 2.3.3. 1. Custom …

Read more

JSF 2 checkboxes example

In JSF, <h:selectBooleanCheckbox /> tag is used to render a single HTML input element of “checkbox” type. //JSF… <h:selectBooleanCheckbox value="#{user.rememberMe}" /> Remember Me //HTML output… <input type="checkbox" name="j_idt6:j_idt8" /> Remember Me While <h:selectManyCheckbox /> tag is used to render a set of HTML input element of type “checkbox”, and format it with HTML table and …

Read more

Spring MVC checkbox and checkboxes example

In Spring MVC, <form:checkbox /> is used to render a HTML checkbox field, the checkbox values are hard-coded inside the JSP page; While the <form:checkboxes /> is used to render multiple checkboxes, the checkbox values are generated at runtime. In this tutorial, we show you 3 different ways of render HTML checkbox fields: 1. <form:checkbox …

Read more

How to check / unchecked a checkbox with jQuery

In jQuery, you can use attr() function to check or unchecked a checkbox dynamically. For example, A simple checkbox component. <input type="checkbox" name="checkme">Check Me</input> 1. To display whether this checkbox is checked or not (return true or false). $(‘input:checkbox[name=checkme]’).is(‘:checked’); 2. To check a checkbox. $(‘input:checkbox[name=checkme]’).attr(‘checked’,true); 3. To uncheck a checkbox. $(‘input:checkbox[name=checkme]’).attr(‘checked’,false); jQuery check / unchecked …

Read more