• Resolved afarinasso

    (@afarinasso)


    Hello, how are you? I would like to know if it is possible to add a javascript function to validate a field at the time of registration and not submit the form until that field is correct. The problem I have is that I can validate correctly but the event of sending the form is fired automatically.

    Thanks in advance.

    Regards from Uruguay

    Andrés Farinasso

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support sanjuacharya77

    (@sanjuacharya77)

    Hi @afarinasso,

    I’m doing well. Regarding your question about validation, we overwrite the jquery.validate.js file with the user-registration-form-validator.js file to incorporate all the necessary validation codes. You can also do the same to add validation as per your requirements. If you make changes to the user-registration-form-validator.js file, they may be lost due to a plugin update. Therefore, we recommend creating a new file and adding the validation accordingly.

    Furthermore, you have the option to handle the validation process using a provided trigger as well:
    $(document).trigger(
    “user_registration_frontend_validate_before_form_submit”,
    [$this]
    );

    By using this trigger, you can effectively manage the validation process after submit button is clicked.

    Regards!

    Thread Starter afarinasso

    (@afarinasso)

    Hi!, very thanks for your response, I´ll try it.
    Have a good day!

    Andrés

    Thread Starter afarinasso

    (@afarinasso)

    Hi again, sorry about my ignorance, I have a number field on the registration form called ‘rut’, i need to check if this field have some characteristics with a function that returns true or false, can you send to me an example of how to use on it?

    $(document).trigger(
    “user_registration_frontend_validate_before_form_submit”,
    [$this]
    );

    Sorry and thanks again, I’m embarrassed but I couldn’t apply it, you save my life.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add javascript for registration field validation’ is closed to new replies.