geoff swartz
geoff swartz

Reputation: 5965

client side validation in mvc 4

I have the following in my web.config...

<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

... and I'm referencing jquery validation in my view...

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>

... but validation is only occurring on the server. What else do I need to do to get client side validation to work? I thought that using the data annotations of [Required] on my model properties and then referencing the jquery validate files that it would then perform client side validation... but apparently there's more to it.

Upvotes: 0

Views: 4402

Answers (1)

Tim
Tim

Reputation: 7421

Use f12 in your chosen browser. And check the console for errors

Upvotes: 3

Related Questions