Wednesday, 28 August 2013

url action in javascript

url action in javascript

How can write this on javascript. Sorry. I'm new in 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.

No comments:

Post a Comment