working with checkboxlist

Posted by Shoyebaziz123 under Regular Expressions on 7/19/2011 | Points: 10 | Views : 1958 | Status : [Member] | Replies : 2
Hi All,

i am not getting any code of checkboxlist with requirement that , if i select all .. then whole list is checked ,but if i am checking some other text then this individual value must be selected or all value except all must be selected . if i toggle or double click all then all value must be select or unselect respectively.


Thanks in advance




Responses

Posted by: Lalji_mer on: 7/19/2011 [Member] Bronze | Points: 25

Up
0
Down
you will get some guide about check box check unchecked using javascript.

http://www.somacon.com/p117.php

LP MER

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shoyebaziz123 on: 7/19/2011 [Member] Starter | Points: 25

Up
0
Down
hi,
i am working with this code

$('input:checkbox').click(function(){
var $this = $(this);

if($this.attr('ref') != 'checkall'){
$(".select-all").attr('checked',false);
}
else {
//Select All
var $checked = $this.is(':checked');
$('input:checkbox').each(function(){
$(this).attr('checked',$checked);
})
$(".select-all").attr('checked',$checked);
}
})


<input type='checkbox' ref='checkall' class='select-all'/>
<input type='checkbox' />
<input type='checkbox' />
<input type='checkbox' />
<input type='checkbox' />
<input type='checkbox' />
<input type='checkbox' />

this works fine on sample code but in my application not working, shows error here ' ref='checkall' '

Shoyebaziz123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response