I am using the CI validation class to do server-side validation and Jquery validation to do client-side validation. Is there some way I can leverage the CI validation and form building, so that when it is creating the form elements it creates them with class="<equivalent of CI validation rules>"? This way, if I change the valiation rules for an element I only have to do it in the CI rules and it automatically changes for Jquery.
Thanks,
Lemaint
You could make ajax calls back to CI for validation using $.ajax or $.post, that way you only have to create your validation rules in CI.
Here’s an example I found to get you started:
jquery post codeigniter validation
Not built-in. Not sure best way to approach this, but you could put all your rules in a validation config file and somehow get your jQuery to parse that file for validation rules when needed.