勾選checkbox之後,button按鈕可用
阿新 • • 發佈:2019-02-16
js:
function chkClick() {
if (document.getElementById("chkBox").checked == true) {
document.getElementById("button按鈕的ID").disabled = false;
eturn true;
} else {
document.getElementById("button按鈕的ID").disabled = true;
return false;
}
}
<input type="checkbox" id="chkBox" class="checkbox_class" onclick="chkClick()" /><span class="textcolor2">《服務條款》</span></li>
<asp:Button ID="btnRegis" Enabled="false" runat="server" CssClass="login_btn" Text="立即註冊" OnClick="btnRegis_Click" />
function chkClick() {
if (document.getElementById("chkBox").checked == true) {
document.getElementById("button按鈕的ID").disabled = false;
eturn true;
} else {
document.getElementById("button按鈕的ID").disabled = true;
return false;
}
}
<input type="checkbox" id="chkBox" class="checkbox_class" onclick="chkClick()" /><span class="textcolor2">《服務條款》</span></li>
<asp:Button ID="btnRegis" Enabled="false" runat="server" CssClass="login_btn" Text="立即註冊" OnClick="btnRegis_Click" />