• Resolved martiuseduardo

    (@martiuseduardo)


    Hi, I want to create a validation rule, but I don’t know how to create it dynamically.
    Example: data-parsley-max=”dynamic value”
    I created a Non Option Variable and can I use that variable in my validation?

    How can I do that?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author moomooagency

    (@moomooagency)

    Hi,

    Please, check this blog post: https://moomoo.agency/create-product-like-on-blinds4udirect-co-uk-in-woocommerce-with-uni-cpo/ It has examples of doing similar things.

    Thread Starter martiuseduardo

    (@martiuseduardo)

    Hi, it didn’t help.

    I have 2 text input.
    input 1: size of the cut
    input 2: quantity of the cut

    If the client wants buy 1 meter (or 100cm), he can cut like that:
    Minimum: 10 cm (=10 pieces of). In the input 2 I need to limit the max of pieces on 10. May have left over.

    If he wants to cut on 25cm (size), then the max limit is 4 pieces (quantity) of the material.
    If he wants to cut on 33cm (size), then the max limit is 3 pieces (quantity).

    Did you understand? The max limit of the input 2 is dynamic.

    Plugin Author moomooagency

    (@moomooagency)

    Of course I did. So do you use conditional validation logic. The blog post I showed you has an example of setting min/max values dynamically for width/height based on the value of the unit. Fits perfectly for you case. Please, study it thoroughly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Validation Logic’ is closed to new replies.