Title: Before Form Submit
Last modified: September 7, 2023

---

# Before Form Submit

 *  Resolved [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/)
 * (@razvanfrandes)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/before-form-submit/)
 * Hello,
   I want to hook into the form submission. For example I want to check if
   the email from the form, matches from a list of emails. And return an error if
   it doesn’t match.I tried buddyforms_update_post_args and buddyforms_after_save_post,
   but this will already create the post and only after they will do my logic.I 
   tried also buddyforms_process_post_start, but this I think is a old hook that
   doesn’t exists anymore.

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

 *  Plugin Author [Sven Lehnert](https://wordpress.org/support/users/svenl77/)
 * (@svenl77)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/before-form-submit/#post-17033094)
 * Hi [@razvanfrandes](https://wordpress.org/support/users/razvanfrandes/) yes, 
   you can do browser and server-side custom validation. Please take a look at the
   documentation on how to create an Ajax request for your custom jQuery validation.
   [https://docs.buddyforms.com/article/692-extend-the-default-validation-with-a-custom-ajax-based-validation](https://docs.buddyforms.com/article/692-extend-the-default-validation-with-a-custom-ajax-based-validation)
 * You can create a custom server site validation or use the inbuilt validation 
   logic. If you are a developer and like to understand the validation, take a look
   at this Documentation [https://docs.buddyforms.com/article/402-validation](https://docs.buddyforms.com/article/402-validation)
 * I hope this answer helps you. Please let me know if you have any questions. I
   like to help.
 *  Thread Starter [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/)
 * (@razvanfrandes)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/before-form-submit/#post-17033341)
 * Thank you.
   It works.I have another question. How I can auto accept and auto login
   users and skip email verification?Can you please guide me?Thank you.
    -  This reply was modified 2 years, 8 months ago by [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/).
 *  Thread Starter [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/)
 * (@razvanfrandes)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/before-form-submit/#post-17033533)
 * I did this
 *     ```wp-block-code
       function custom_buddyforms_auto_activate_user($post_id) {
   
         $user_id = get_post_field('post_author', $post_id);
   
         $user = get_user_by('id', $user_id);
   
         if ($user) {
   
           // Remove the activation key for the user to simulate activation.
   
           delete_user_meta($user_id, 'activation_key');
   
           // Log the user in.
   
           wp_clear_auth_cookie();
   
           wp_set_current_user($user->ID);
   
           wp_set_auth_cookie($user->ID);
   
         }
   
       }
   
       add_action('buddyforms_after_save_post', 'custom_buddyforms_auto_activate_user');
       ```
   
    -  This reply was modified 2 years, 8 months ago by [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/).

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

The topic ‘Before Form Submit’ is closed to new replies.

 * ![](https://ps.w.org/buddyforms/assets/icon-256x256.jpg?rev=2227973)
 * [Post Form - Registration Form - Profile Form for User Profiles - Frontend Content Forms for User Submissions (UGC)](https://wordpress.org/plugins/buddyforms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddyforms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddyforms/)
 * [Active Topics](https://wordpress.org/support/plugin/buddyforms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddyforms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddyforms/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [razvanfrandes](https://wordpress.org/support/users/razvanfrandes/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/before-form-submit/#post-17033533)
 * Status: resolved