Support » Plugin: WC Fields Factory » Add validation in field before shop / add cart

  • Hi!

    Here in Brazil we have an identification document called CPF with 11 digits, mask “999.999.999-99”.

    The last two are digits to check the first nine, and there is a formula for that.

    My product screen is the inscription in a street race, in which the athlete informs his name, date of birth and CPF.

    When I click the “shop” button, I want to validate the CPF field through the function that calculates if the digits are correct.

    How can I implement this validation function when adding the product to the cart or when the user finishes typing the field?

Viewing 1 replies (of 1 total)
  • Hi!

    I need create a text field (or number field with input mask). The field contains a number with 11 numeric digits and the following mask: 999.999.999-14.

    The mask is ok. But I need to do a validation for the last 2 digits, which are checking the first 9 digits. I have a jquery function ready for this.

    How do I add this validation function in ampo, in the same way as the required field validation?

    That is, by clicking the XXX button I want the program to check:

    1. If the field has been filled (ok)
    2. My custom validation function

Viewing 1 replies (of 1 total)
  • The topic ‘Add validation in field before shop / add cart’ is closed to new replies.