How should I use CustomCode

Home Forums Jquery Validation for Contact Form 7 How should I use CustomCode

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #481076
    Ruri Flora Newman
    Guest

    Hi there,

    I have a scenario where I would like 2 fields, both number fields, to have different error messages based on class name. This is because both these fields have different min and max values.

    I have tried to achieve this with the following:
    [number* leg-spct min:0 max:100 class:digits]
    [number* leg-spct min:0 max:100 class:number]

    But both shows error message that I have set for numbers.
    Kindly assist me with this ASAP.

    #481122
    Dinesh
    Keymaster

    Hi Ruri,

    When you use these class.

    Minimum Number : Minimum numeric value user can input. Like: Age must be 18+.
    Use class JVmin-#. Where # is minimum numeric value required.

    Maximum Number : Maximum numeric value user can input. Like: Age mustt not be above 100.
    Use class JVmax-#. Where # is maximum numeric value required.

    Error message changes based on the min and max value.

    Thanks

    #481137
    Ruri Flora Newman
    Guest

    Hi Dinesh,

    Thanks for your reply.

    What if I want the field to accept within a range?

    For example, in one field, the only acceptable number is 100 – no lower, no higher.

    For another field, I want it to be within 0-21.

    Appreciate your help.

    #481138
    Ruri Flora Newman
    Guest

    Here are my 3 fields I would like:

    1. Field should accept between 1-20 – anything else, error message has to show “The age has to be between 1-20”

    2. Field should be greater than 1, but lesser than 100 – anything else, error message has to show “This field needs a percentage greater than 0 and less than 100”

    3. Field should be 100 only (min 100, max 100) – anything else, error message has to show “This field’s percentage should total up to a 100”

    #481182
    Dinesh
    Keymaster

    Hi Ruri,

    I am so sorry but such different message for same validation method is not available with our plugin.

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How should I use CustomCode’ is closed to new replies.