Heinz
Heinz

Reputation: 115

MVC Validation Summary manipulation with JS and Dynamic DOM elements

I am adding fields after the page load and would like to know how I can interface my JS with .net's validation summary on MVC.

Does a simple way exist?

Thx!

Upvotes: 0

Views: 2040

Answers (2)

Adam Tuliper
Adam Tuliper

Reputation: 30152

The easiest method is to use jQuery and get the validation summary.

var ul = $("#validationSummary ul");
ul.append("<li>Custom Error Message</li>")

as is done here: link text

Upvotes: 2

Kailas Mane
Kailas Mane

Reputation: 1935

You can use asp.net MVC with its server side and client side validations. Basically you need to apply rules for validation while defining a models (Class Files)

Following is link which will describe Model Validation in ASP.NET MVC.

Model Validation in ASP.NET MVC

Upvotes: 0

Related Questions