Title: Custom Input Validation
Last modified: March 3, 2020

---

# Custom Input Validation

 *  Resolved [mimmo99](https://wordpress.org/support/users/mimmo99/)
 * (@mimmo99)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/custom-input-validation-2/)
 * Hi,
    I need to validate some fields and I found your “wppb_check_form_field_input”
   filter but the “wppbc_custom_input_validation” function is not called.
 * I inserted this code in functions.php and after various tests I simply understood
   that it is not called.
 * In my functions.php
 *     ```
       /* handle field validation */
       add_filter( 'wppb_check_form_field_input', 'wppbc_custom_input_validation', 20, 4 );
       function wppbc_custom_input_validation( $message, $field, $request_data, $form_location ){
       echo "<script>console.log('TEST' );</script>";
       return $message;
       }
       ```
   
 * What’s the problem?
    Thank you!

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

 *  Plugin Author [Cristian Antohe](https://wordpress.org/support/users/sareiodata/)
 * (@sareiodata)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/custom-input-validation-2/#post-12510827)
 * Hi,
 * Whatever is returned is what’s being outputted. You need to do something like:
 * return $message . $js_script;
 * However, the main reason why it’s not being called is because that filter is 
   not found in the Free version.
 * Instead it’s found inside wp-content/plugins/profile-builder-pro/front-end/extra-
   fields/input/input.php
 * If you open other fields like last-name.php you’ll notice the filter is actually
   different:
 * add_filter( ‘wppb_check_form_field_default-last-name’, ‘wppb_check_last_name_value’,
   10, 4 );
 *  Thread Starter [mimmo99](https://wordpress.org/support/users/mimmo99/)
 * (@mimmo99)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/custom-input-validation-2/#post-12513303)
 * Thanks a lot for the answer. But then, in the free version, can’t I validate 
   a custom input field? 🙁
 * Thanks

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

The topic ‘Custom Input Validation’ is closed to new replies.

 * ![](https://ps.w.org/profile-builder/assets/icon-256x256.png?rev=2961144)
 * [User Profile Builder - Beautiful User Registration Forms, User Profiles & User Role Editor](https://wordpress.org/plugins/profile-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/profile-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/profile-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/profile-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/profile-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/profile-builder/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mimmo99](https://wordpress.org/support/users/mimmo99/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/custom-input-validation-2/#post-12513303)
 * Status: resolved