html pushed to the page:
<span class="AuthorizationGroup"><input id="ctl00_ContentPlaceHolder1_hsLkup_chkAuthApproved" type="checkbox" name="ctl00$ContentPlaceHolder1$hsLkup$chkAuthApproved" /></span> Approved
<span class="AuthorizationGroup"><input id="ctl00_ContentPlaceHolder1_hsLkup_chkAuthDeclined" type="checkbox" name="ctl00$ContentPlaceHolder1$hsLkup$chkAuthDeclined" /></span> Declined
<span class="AuthorizationGroup"><input id="ctl00_ContentPlaceHolder1_hsLkup_chkAuthNoResponse" type="checkbox" name="ctl00$ContentPlaceHolder1$hsLkup$chkAuthNoResponse" checked="checked" /></span> No Response
I can get my checboxes without any problem like this:
$([COLOR=maroon]".[/COLOR]AuthorizationGroup[COLOR=maroon]"[/COLOR]).find([COLOR=maroon]"input[type='checkbox']"[/COLOR]).checkboxUncheckOthers([COLOR=blue]true[/COLOR], [COLOR=blue]false[/COLOR]);
When in the uncheck plugin in, i use “name”, i get object doesn’t support this property or method. Basically, if current CLICKED one is checked then i want to uncheck all the remaining that are checked in that group. This code works with html check boxes. I think, the problem is the $ in the name (pushed by asp.net). How can i get around this problem?
plugin code
[COLOR=darkgreen]//checkbox uncheck others[/COLOR] jQuery.fn.checkboxUncheckOthers = [COLOR=blue]function[/COLOR] (blnKeepCurrentChecked, blnApplyHighLight) {
[COLOR=blue]if[/COLOR] (blnKeepCurrentChecked == [COLOR=blue]null[/COLOR] || blnKeepCurrentChecked == [COLOR=maroon]'undefined'[/COLOR] || [COLOR=blue]typeof[/COLOR] blnKeepCurrentChecked != [COLOR=maroon]'boolean'[/COLOR])
blnKeepCurrentChecked = [COLOR=blue]false[/COLOR]; [COLOR=blue]
if[/COLOR] (blnApplyHighLight == [COLOR=blue]null[/COLOR] || blnApplyHighLight == [COLOR=maroon]'undefined'[/COLOR] || [COLOR=blue]typeof[/COLOR] blnApplyHighLight != [COLOR=maroon]'boolean'[/COLOR])
blnApplyHighLight = [COLOR=blue]false[/COLOR]; [COLOR=blue]
var[/COLOR] handleState = {
item: [COLOR=blue]function[/COLOR] ($clicked, $obj) { [COLOR=blue]
var[/COLOR] clickedIndex = $clicked.getIndexOfItemClickedRadioCheckBox(); $obj.each([COLOR=blue]function[/COLOR] (index) {
[COLOR=blue]if[/COLOR] (clickedIndex != index)
$([COLOR=blue]this[/COLOR]).attr([COLOR=maroon]"checked"[/COLOR], [COLOR=blue]false[/COLOR]); [COLOR=blue]
else[/COLOR] [COLOR=blue]if[/COLOR] (clickedIndex == index && blnKeepCurrentChecked && !$([COLOR=blue]this[/COLOR]).is([COLOR=maroon]":checked"[/COLOR])) {
$([COLOR=blue]this[/COLOR]).attr([COLOR=maroon]"checked"[/COLOR], [COLOR=blue]true[/COLOR]);
}
});
}
}; [COLOR=blue]
return[/COLOR] [COLOR=blue]this[/COLOR].each([COLOR=blue]function[/COLOR] () {
$([COLOR=blue]this[/COLOR]).click([COLOR=blue]function[/COLOR] () {
alert($([COLOR=blue]this[/COLOR]).attr([COLOR=maroon]"name"[/COLOR]));
handleState.item($([COLOR=blue]this[/COLOR]), $([COLOR=maroon]'input[name='[/COLOR] + $([COLOR=blue]this[/COLOR]).attr([COLOR=maroon]"name"[/COLOR]) + [COLOR=maroon]']'[/COLOR])); }); $([COLOR=blue]this[/COLOR]).keyup([COLOR=blue]function[/COLOR] () { handleState.item($([COLOR=blue]this[/COLOR]), $([COLOR=maroon]'input[name='[/COLOR] + $([COLOR=blue]this[/COLOR]).attr([COLOR=maroon]"name"[/COLOR]) + [COLOR=maroon]']'[/COLOR])); }); }); }