Great! Thanks!

On Aug 24, 8:23 am, SeViR <[EMAIL PROTECTED]> wrote:
> voltron escribió:> Thanks for the reply SeVir, but I´m confused, do you have 
> a small
> > example of what you mean?
>
> > Do you mean that I should create the input field with javascript and
> > remove it based on the users input?
>
> Sorry, I understanded that your input fields are loaded dinamically. But
> I can see, you
> need some different. So, this is an example for you:
>
> $("#myform [EMAIL PROTECTED]").change(function(){
>     if (this.checked && this.value == "zipcode"){
>        $("#myform").unbind("submit");
>        $("#myform").validate(
>           //your rules
>         );
>     }else if (this.checked && this.value == "city"){
>        $("#myform").unbind("submit");
>        $("#myform").validate(
>           //another rules
>         );
>     }
>
> });
>
> Simply unattach submit event for remove the last validation, and set
> another again,
> depending the option.
>
> > On Aug 23, 8:26 am, SeViR <[EMAIL PROTECTED]> wrote:
>
> >> voltron escribió:> Hi all,
>
> >>> I have a text input field declared to be used for searching a
> >>> database. The users can search for a zipcode, city or company name
> >>> based on what the choose using a radio button. How can I then
> >>> dynamically assign different validation rules to the input field using
> >>> Jörns Validation plugin?
>
> >>> Thanks
>
> >> Maybe calling again to validate() method using the new rules?, also I
> >> suppose that
> >> if you use metadata rules, the rules are evaluated on submit, so you can
> >> insert the input fields dinamically with the rules inline the html code.
>
> --
> Best Regards,
>  José Francisco Rives Lirola <sevir1ATgmail.com>
>
>  SeViR CW · Computer Design
>  http://www.sevir.org
>
>  Murcia - Spain

Reply via email to