jquery - Validating form with Model State on Client Side in MVC -
i trying validate form on button click. form (view) bounded model , model properties wrapped data-annotations
, before other action, want validate form jquery.
$("#btnsubnext,#btnsublast").on('click', function () { $("#myform").validate(); if ($('#myform').valid()) { } });
but not working properly.
note: myform
id
of form mentioned below:
@using (html.beginform("cceaddupdateschedulea", "cceschedule", formmethod.post, new { @id = "myform", @name = "myform", @class = "myform" })) {..... }
do have clientvalidationenabled , unobtrusivejavascriptenabled true in web.config? need jquery.validate , jquery.validate.unobstrusive. check http://www.asp.net/mvc/overview/older-versions/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript
Comments
Post a Comment