Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

Thanks for helping advance.

I have to save multiple values at once in that at least one value should be entered
and i want to show one message for all in a container .
in mvc view the name is generating like this AddVm[].AttributeValue .
i am able to put validation but its generating for all but i want only one message
that should be in one container.

$.each($('.licenseattributevalreq'), function () {
       $(this).rules('add', {
           require_from_group: [1, '.licenseattributevalreq'], messages: { require_from_group :"Please fill atlease one Attribute Value."}
       });
   });
   if ($('.licenseattributevalreq').valid() == false) {return false; };

its working properly

What I have tried:

$.each($('.licenseattributevalreq'), function () {
$(this).rules('add', {
require_from_group: [1, '.licenseattributevalreq'], messages: { require_from_group :"Please fill atlease one Attribute Value."}
});
});
if ($('.licenseattributevalreq').valid() == false) {return false; };
Posted
Comments
Sunasara Imdadhusen 15-Mar-17 9:07am    
In that case you can remove the validation for all and use custom validation on button click to validate the inputs.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900