I am trying to fire ServerClick event in .NET on button click. it works fine if I don't add onclick="return ValidateForm();"
<button runat="server" id="btn1" type="submit" onclick="return ValidateForm();">SAVE</button>
I have already declared a javascript function in head as below:
<script>
function ValidateForm(){
//some validation code, return true/false
return true;
}
</script>
Below button also works fine:
<button runat="server" id="btn1" type="submit" onclick="return true;">SAVE</button>
but if I add onclick="return somefunction" its not working.
What I am doing wrong ?
Thanks
<script type="text/javascript">