Title: Function called before registration
Last modified: September 1, 2016

---

# Function called before registration

 *  Resolved [pablow3v](https://wordpress.org/support/users/pablow3v/)
 * (@pablow3v)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/function-called-before-registration/)
 * Hi, good morning.
    Could you tell me which function is called after the user 
   complete a field? (Before click at the registration button).
 * I want to put a ‘validation’ before user click in the registration button.
 * (I tried some functions but none work how I want).
 * I don’t know if I were clear, so an example: After the user put the email would
   show a notification “the email is too short…”.
 * Thank you for the help, support and congratulations for your the plugin and website.
 * [https://wordpress.org/plugins/wp-members/](https://wordpress.org/plugins/wp-members/)

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

 *  Thread Starter [pablow3v](https://wordpress.org/support/users/pablow3v/)
 * (@pablow3v)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-7706152)
 * More one thing. I were testing some function like this:
 *     ```
       if($fields['somefield1'] == 'something'){
       		 $fields['somefield2'] = 'newthing';
       }
       ```
   
 * The variable was changed but it’s not showing in the form. How could I do this?
 * Thank you a lot.
    Pablo
 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-7706225)
 * You can’t validate the form fields prior to the button being clicked using the
   plugin (as you described). If you want that type of validation, you’d need to
   write (and load) some client side javascript to handle it.
 * You can, however, add your own custom validation to the form upon submission.
   Using the wpmem_pre_register_data action hook, if you validate whatever field
   you want (or multiple fields), if the data doesn’t meet whatever criteria, set
   a value for $wpmem_themsg as the error message.
 * [http://rocketgeek.com/wp-members-users-guide/filter-hooks/wpmem_pre_register_data/](http://rocketgeek.com/wp-members-users-guide/filter-hooks/wpmem_pre_register_data/)
 * The second thing you asked – setting a value of something based on another field’s
   value – can be done filtering the posted form results with wpmem_register_data:
 * [http://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_register_data/](http://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_register_data/)
 *  Thread Starter [pablow3v](https://wordpress.org/support/users/pablow3v/)
 * (@pablow3v)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-8150380)
 * Hi, I need to do a extra button that it validate one field and other thing. I
   have a function that do this but the way that i call it conflicts with the form.
 * I’m use it:
 *     ```
       <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js" ></script>
           <script type="text/javascript" src="http://(WebSite).com/ajax.js" ></script>
       ```
   
 * And I used “ajax” to call the php file to do the validation by the extra button.
 * How can I call this function without conflicts with the form?
 * If you can tell me how I can put the extra button beside a field it’ll help very
   much too.
 * Thank you for all help until now.
    Pablo
    -  This reply was modified 9 years, 9 months ago by [pablow3v](https://wordpress.org/support/users/pablow3v/).
 *  Thread Starter [pablow3v](https://wordpress.org/support/users/pablow3v/)
 * (@pablow3v)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-8155461)
 * One more thing, when I don’t fill a required field, when I press the button to
   register a mensagem is shown to fill all required field.
 * I want to call a validation before it call that message. The “wpmem_pre_validate_form”
   is called after this message.
 * How could I call it before?
 * Have a good day and thanks very much.
 * Pablo
 *  Thread Starter [pablow3v](https://wordpress.org/support/users/pablow3v/)
 * (@pablow3v)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-8272518)
 * Huum…
 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-8622692)
 * > One more thing, when I don’t fill a required field, when I press the button
   > to register a mensagem is shown to fill all required field.
   > I want to call a validation before it call that message. The “wpmem_pre_validate_form”
   > is called after this message.
 * The plugin’s HTML for the forms uses HTML5. HTML5 has automatic form validation
   built in. So if a field is marked as required, you will receive a message right
   away. That’s the message you are talking about. HTML5 validation happens before
   any submit event, in all browsers, so it’s not possible to do anything prior 
   to that.

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

The topic ‘Function called before registration’ is closed to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

## Tags

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

 * 6 replies
 * 2 participants
 * Last reply from: [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/function-called-before-registration/#post-8622692)
 * Status: resolved