Tuesday, March 26, 2013

Enable/Disable ASP.NET button on CheckBox Checked/Uncheked using Jquery


<form id="form1" runat="server">
<div class="smallDiv">
<h2>Click on the Checkbox to Enable the Button control</h2>
<asp:CheckBox ID="cb1" runat="server"
Text="Check To Toggle the Enabled status of the Button"
Tooltip="Click Here To Enable/Disabled the CheckBox"/><br /><br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />

Jquery Script:

<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
$(function () {
var $btn = $(":submit[id$=btnSubmit]");
var $chk = $(":input:CheckBox[id$=cb1]");

// check on page load

$chk.click(function () {

function checkChecked(chkBox) {
if ($chk.is(':checked')) {
else {
$btn.attr('disabled', 'disabled')

No comments:
Write comments
Recommended Posts × +