freesurgeon
New member
I have a button which i want to enable when a checkbox is checked. I did it successfully by setting the AutoPostBack of the checkbox to true, when i check it, the page reloads and the button is enabled. But the problem is I want to do this without the page being reloaded. Is there a way to do it without the use of javascript?
I tried creating a javascript function as follows:
<script language="javascript">
function EnableButton(obj) {
document.getElementById('<%=btnNext.ClientID%>').disabled=!obj.checked; }
</script>
and i called this function "EnableButton" on my aspx source page on the Checkbox property adding "oncheckedboxchanged="EnableButton" I don't see anything wrong here but when compiling it says "register.aspx does not contain a definition for 'EnableButton'
where am i going wrong?
any help would be appreciated
thanks, i did it finally and i didn't have to use ClientID or anything. i just used the control names. long story. thanks again
I tried creating a javascript function as follows:
<script language="javascript">
function EnableButton(obj) {
document.getElementById('<%=btnNext.ClientID%>').disabled=!obj.checked; }
</script>
and i called this function "EnableButton" on my aspx source page on the Checkbox property adding "oncheckedboxchanged="EnableButton" I don't see anything wrong here but when compiling it says "register.aspx does not contain a definition for 'EnableButton'
where am i going wrong?
any help would be appreciated
thanks, i did it finally and i didn't have to use ClientID or anything. i just used the control names. long story. thanks again
