2025-02-09

 

主要代碼:

html部分:

 

 

<input id="rblSure_0" type="radio" name="rblSure" value="agree" /> 

<label for="rblSure_0"> 

    同意</label> 

<input id="rblSure_1" type="radio" name="rblSure" value="disagree" checked="checked" /> 

<label for="rblSure_1"> 

    不同意</label>  

 

js部分(註意引入jquery-1.4.2.js文件):

 

 

 

 

//同意或不同意的處理 

$("#<%=btnSumbit.ClientID%>").attr("disabled", "disabled"); 

$("input[name='rblSure']").eq(0).click(function() { 

    $("#<%=btnSumbit.ClientID%>").attr("disabled", ""); 

}); 

$("input[name='rblSure']").eq(1).click(function() { 

    $("#<%=btnSumbit.ClientID%>").attr("disabled", "disabled"); 

}); 

摘自 hi_dzj的專欄

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *