Have an issue with javascript Jquery and php buttons for checkbox

NetID

New Member
I have a problem with this code :\[code\] jQuery(".cb-disable").click(function(){ var parent = jQuery(this).parents('.switch'); var vid =this.id; jQuery('#'+vid).attr('id',''); jQuery('#'+vid).attr('id',''); jQuery('.cb-enable',parent).removeClass('selected'); jQuery(this).addClass('selected'); jQuery('input[name='+vid+'-off]').attr('checked', true) jQuery('input[name='+vid+'-on]').removeAttr('checked'); jQuery('input[name='+vid+']').attr('name', vid+"-on"); jQuery('input[name='+vid+'-off]').attr('name', vid); }); });\[/code\]because this code is correct for the example code below.\[code\]<p class="wpptabs_hoverable-286 switch"> <input type="radio" id="ON" class="on286" name="wpptabs_hoverable-286" value="http://stackoverflow.com/questions/15605318/on" checked="checked"> <input type="radio" id="OFF" class="off286" name="wpptabs_hoverable-286-off" value="http://stackoverflow.com/questions/15605318/off"> <label for="ON" id="" class="cb-enable"><span>ON</span></label> <label for="OFF" id="" class="cb-disable selected"><span>OFF</span></label></p>\[/code\]But it isn't correct. Can you help me?This code is based on http://devgrow.com/iphone-style-switches/for php generating a checkbox in table column.Sorry for my english, but I rarely write in this language
 
Back
Top