Title: Form validation
Last modified: November 13, 2020

---

# Form validation

 *  Resolved [josippapez](https://wordpress.org/support/users/josippapez/)
 * (@josippapez)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/form-validation-19/)
 * Is there any way to execute form validation for profile registration form and
   show the errors if there are any before the page refreshes after clicking on “
   Register” button?
 * The problem is that when I type in password and password confimation the form
   shows that the password should be by certain rules, like one capital letter and
   so on, after the page refreshes. That’s only one example, it’s also present for
   other required.

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

 *  [Nicolas](https://wordpress.org/support/users/nchaccal/)
 * (@nchaccal)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/form-validation-19/#post-13659574)
 * I made this with pure javascript.
 * I think Ultimate Members forms uses only server validation, except for the confirm
   password field, which change border to red if password doesn’t match.
 * For example, i use this code to validate userlogin field with the keyup listener
   and the um_after_register_fields hook.
 * If username doesn’t match with my custom function (validate_ci), which is not
   in this example, the background field will be red. Otherwhise, will be green:
 *     ```
       function customID() {
           ?>
               <script>
   
       	var valinput = document.querySelector("#user_login-534");
   
       			valinput.addEventListener('keyup', function(){
         			if (validate_ci(valinput.value)){
           		valinput.style.background = "#9deb91";
       			} else{
           		valinput.style.background = "#eb91ae";
         			}
       			});
               </script>
           <?php
       }
       add_action('um_after_register_fields', 'customID');
       ```
   
 * Hope this help.
 * See ya!
 *  Plugin Contributor [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * (@champsupertramp)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/form-validation-19/#post-13667418)
 * Hi [@josippapez](https://wordpress.org/support/users/josippapez/)
 * Sorry for the late response. [@nchaccal](https://wordpress.org/support/users/nchaccal/)’
   s correct – We only have a server-side validation available for now but we’ve
   added this to our future improvements in the next couple of weeks.
 * Please feel free to re-open this thread by changing the topic status to “Not 
   Resolved” so we can get back to you.
 * Regards,

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

The topic ‘Form validation’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [Champ Camba](https://wordpress.org/support/users/champsupertramp/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/form-validation-19/#post-13667418)
 * Status: resolved