Title: Add javascript for registration field validation
Last modified: August 1, 2023

---

# Add javascript for registration field validation

 *  Resolved [afarinasso](https://wordpress.org/support/users/afarinasso/)
 * (@afarinasso)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/add-javascript-for-registration-field-validation/)
 * 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](https://wordpress.org/support/users/sanjuacharya77/)
 * (@sanjuacharya77)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/add-javascript-for-registration-field-validation/#post-16940762)
 * Hi [@afarinasso](https://wordpress.org/support/users/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](https://wordpress.org/support/users/afarinasso/)
 * (@afarinasso)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/add-javascript-for-registration-field-validation/#post-16944405)
 * Hi!, very thanks for your response, I´ll try it.
   Have a good day!
 * Andrés
 *  Thread Starter [afarinasso](https://wordpress.org/support/users/afarinasso/)
 * (@afarinasso)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/add-javascript-for-registration-field-validation/#post-16992206)
 * 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.

 * ![](https://ps.w.org/user-registration/assets/icon-256x256.gif?rev=3284028)
 * [User Registration & Membership - Free & Paid Memberships, Subscriptions, Content Restriction, User Profile, Custom User Registration & Login Builder](https://wordpress.org/plugins/user-registration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-registration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-registration/)
 * [Active Topics](https://wordpress.org/support/plugin/user-registration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-registration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-registration/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [Registration](https://wordpress.org/support/topic-tag/registration/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * 3 replies
 * 2 participants
 * Last reply from: [afarinasso](https://wordpress.org/support/users/afarinasso/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/add-javascript-for-registration-field-validation/#post-16992206)
 * Status: resolved