Performing both client side and server side functions on button click -
Specific Scenario
I have a checkbox, label and button control. If the checkbox is not
checked and button is clicked, I need to display a message in label
stating to check the checkbox first. If the checkbox is checked and then
the button clicked, it should allow me to proceed.
This is very similar to the terms and conditions screens,where if you dont
check the checkbox - you are not allowed to proceed.
I am using the below javascript. Please let me know how do I accomplish
this functionality?
<script type="text/javascript">
function testCheckbox() {
var obj = document.getElementById('<%= chkTerms.ClientID %>');
if (obj.checked == false) {
document.getElementById("lblCheck").style.visibility = "visible";
return false;
}
}
</script>
No comments:
Post a Comment