views:

55

answers:

1

I want to submit a form like this:

<input type="button" onclick="$('#form1').submit();" value="Create" />

but the ASP.NET MVC 2 Model Validation doesn't work.

+1  A: 

You could try simulating a click on the actual submit button:

<input type="button" onclick="$('#form1 input:submit').click();" value="Create" />
Darin Dimitrov
This way is good! Thanks!But I have to put a hidden submit button in my form.I wait to see if there is a better way.
ldp615
It is semantically more correct to submit forms with submit or image buttons.
Darin Dimitrov