ASP.Net MVC, Submit a form using javascript

You can use jquery to submit the form:

<% using (Html.BeginForm(null, null, FormMethod.Post, new { id = "myForm"})) { %>

(the last part is for htmlAttributes parameter)

just do this:

$("#myForm").submit();

and do not forget to include jquery-1.2.6.js that comes with mvc (or use a higher version).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)