atleast one field required jquery validation performance issue -
jquery validate - require @ least 1 field in group filled
i tried above both solution jquery validation..every thing working fine slow..some times ie throwing error "some scripts running slow , may effect system performance or that"..
i know causing issue...i have 20 fields on page..and each field calling method more once , 20 times 2 or more that...its guess..i not pretty cause problem..is using solution..is 1 have issue..or missing something..
i tried post question in stackoverflow link..but not supposed that..thats why creating question...please have idea it.. please me... lot..
you use simple jquery script following validation.
this loop through input text fields within form, check if have value , submit if 1 or more filled in, if not display error message screen , prevent form being submitted.
<script type="text/javascript"> $(function() { $('form').submit(function() { var isvalid = false; $(this).find('input:text').each(function() { if ($(this).val().length > 0) isvalid = true; }); if (!isvalid) $('#errormsg').text('please fill in 1 of fields!'); return isvalid; }); }); </script>
this may improve performance issues preforms validation when submitting form.
hope helps!
Comments
Post a Comment