there is a checkbox and a textbox. initially the textbox is set disabled and on checking the checkbox the textbox in enabled. i hv tried this but the problem is that it is not working when runat server is added. or i should change javascript logic for asp.net standard controls. or can suggest me a beeter way to do this.
<script type="text/javascript">
$(document).ready(function() {
var checkbox = $('#htmlChkNotify');
var textfield = $('#htmlTxtNotifyemailaddress');
checkbox.click(function() {
if (checkbox.is(':checked')) {
textfield.removeAttr('disabled');
textfield.removeClass("email");
}
else {
textfield.attr('disabled', 'disabled');
textfield.addClass("email");
}
});
});
</script>
<input type="checkbox" id="htmlChkNotify"/>
<label for="htmlChkNotify">Notify</label>
<input type="text" id="htmlTxtNotifyemailaddress" disabled="disabled"
class="email" style="width:25%" />