Reputation: 12294
ok i have a complete form in my database as row for example name of the field ,is mandatory, sortid, regularexpression, datatype, maxlength , default value etc. So the form is completely dynamic.
now i want to perform the client side validation on the form . What will be the best practice for doing that? like i have to see that if the field is mandatory check it for null and if not then leave it on the client side . i am thinking about setting hidden field for it .
can u guys guide me better in this scenario.
Upvotes: 0
Views: 737
Reputation: 5028
You might want to check out this project, which is for generating dynamic forms in MVC.
If you download the most recent code theres stuff in there for doing client side validation with jquery
http://mvcdynamicforms.codeplex.com/
Upvotes: 1
Reputation: 11658
You could dynamically construct javascript to test this form on client. Or you could use jquery.validate plugin and do right mark-up of your html.
Upvotes: 1