How to submit?

Can I submit to <% using (Ajax.BeginForm("ChangePassword", new AjaxOptions { OnComplete = "ChangePasswordComplete" }))

without a submit button on the form?

I am yes, how? Let's say I want to post above when the user just presses the type enter button?

+2


a source to share


1 answer


You will need to use Javascript to submit the form, jQuery has a submit method that you can use.

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

      

But really, the input of the type button is the same as for submit, only it is sent automatically so that you can use it.



Progressive improvement

Alternatively, you can use the jQuery Form plugin to post a standard form (using Html.BeginForm

or manually inject <form />

) and this will work for people who don't have Javascript in their browser.

0


a source







All Articles