How can write this on javascript. This is on html form.
<form action="@Url.Action("NewPage")" >
....
</form>
Now I have javascript function.
function validateForm() {
//var x = document.forms["form"]["fname"].value;
var x = document.getElementById('id').value;
if (x == null || x == 0 || x == "0") {
alert("stop");
return false;
}
else {
document.form.submit();
}
}
What should be in the html form action.