1. 程式人生 > >單選按鈕i-check選中觸發

單選按鈕i-check選中觸發

//單選按鈕選中觸發
	$('.carries_type').on('ifChecked', function(event){  
		debugger;
		alert($(event.target).val());
		
	});
	
//取 單選按鈕值
	$("#typeRadiobuttons input.i-checks:radio").each(function(){
	    if(true == $(this).is(':checked')){
	      alert("-----"+$(this).val());
	    }
	});
	//清除選中
	$('#type1, #type1').iCheck('uncheck');
	


獲取當前選中單選按鈕的value 

<td style="width:25%;" colspan="3" id="typeRadiobuttons">
                                <form:radiobuttons path="type" items="${fns:getDictList('carries_type')}" itemLabel="label" itemValue="value" class="i-checks carries_type" htmlEscape="false" />
</td>

官網附上:

http://www.bootcss.com/p/icheck/#usage