KiPiPo.com blog gadget design wallpaper web programming review

20Aug/120

check checkbox with specific value ( using jQuery )

To check/uncheck checkbox with specific value using jQuery.

To check checkbox with id lead with "chk_hobby_" and has value = 7 :

$("#data-form input[id^='chk_hobby_'][value=7]").prop('checked',true);

To uncheck checkbox with id lead with "chk_hobby_" and has value = 2 :

$("#data-form input[id^='chk_hobby_'][value=2]").prop('checked',false);

HTML Sample :

<form id="data-form">Hobby
<div><input id="chk_hobby_2" type="checkbox" name="hobby[]" value="2" checked="true" /> <label>Swimming</label></div>
<div><input id="chk_hobby_6" type="checkbox" name="hobby[]" value="6" /> <label>Watching Movie</label></div>
<div><input id="chk_hobby_7" type="checkbox" name="hobby[]" value="7" /> <label>Bowling</label></div>
</form>
Demo :
http://jsfiddle.net/B6Jks/
Tagged as: No Comments
19Jun/110

CSS Generator Tools

Here some useful web design tools for make your live easier  :) .

CSS Button Generator - button.csscook.com

CSS Button Generator

CSS Layout Generator - csslayoutgenerator.com

Tagged as: Continue reading