1
votes

I'm using the latest RC with asp.net mvc 3, and have turned on unobtrusive javascript validation and added the necessary scripts to the page. All of the validation works perfectly, but when I try to submit the page, it simply doesn't post. If I turn unobtrusive javascript off in the web.config without making any other changes, everything works perfectly fine.

Here's my scripts I'm using:

<script src="@Url.Content("~/Scripts/jquery-1.4.4.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>

Inside the page it's just a standard form using Html.BeginForm().

2

2 Answers

3
votes

Might help to put some more information so we can try to repro this.

The form won't post if something is invalid. So chances are a field is not valid, but you maybe you don't have the display set up properly. Did you make sure to add a call to Html.ValidationMessageFor(...) for each form field? That renders a span where the client validation message appears.

0
votes

This also happens when hidden fields are required. Such a simple thing, but it has caused me quite a bit of stress.