I have a form like that:
<script type="text/javascript">
function checkpas()
{
var newp = $('#NewPassword').val();
var newpp = $('#RepeatedNewPassword').val();
if (newp != newpp)
{
return false;
}
}
</script>
<% using (Html.BeginForm()) {%>
<%: Html.ValidationSummary(true) %>
...
<input type="submit" id="sub_btn" value="Edit" onclick="checkpas();" />
<% } %>
but that submit input always invokes a form submit, even if I return false in the JS code. Why ?