Title: Numeric Field
Last modified: August 27, 2021

---

# Numeric Field

 *  Resolved [oreroy](https://wordpress.org/support/users/oreroy/)
 * (@oreroy)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/numeric-field/)
 * Hello
    To prevent spam and using the numeric field I added this question to my
   form (last question): To prevent spam tell us please the correct answer for 7
   +7
 * Form link:
    [https://cateringindubai.com/new-company-form01/](https://cateringindubai.com/new-company-form01/)
 * I also made the only possible answer 14, if someone type any other number he 
   cannot send the form.
 * However I am still receiving spam messages and whats weird is that most of the
   times the answers for 7+7 are words and not 14, knowing its a numeric field and
   you can only add a number

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

 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/numeric-field/#post-14813048)
 * Hi [@oreroy](https://wordpress.org/support/users/oreroy/)
 * Sorry to hear you are having this issue.
 * I need to be honest I tried to edit the value in the source code and bypass the
   numeric field but it didn’t allow me to easily type the plus signal.
 * But if you are having spam issues had you tried to enable some protection modules?
 * Forminator has a ReCaptcha field, [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#recaptcha-field](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#recaptcha-field),
   honeypot protection & Akismet spam protection
    [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#behavior-forms](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#behavior-forms)
 * CleanTalk Anti-Spam [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#cleantalk-anti-spam](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#cleantalk-anti-spam)
 * Let us know the result you got when using any of those security options.
 * Best Regards
    Patrick Freitas
 *  Thread Starter [oreroy](https://wordpress.org/support/users/oreroy/)
 * (@oreroy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14837809)
 * Hello
    Please check the attachment to see an example: [https://www.dropbox.com/s/42o4gxbf2b69iho/Forminator%20Numeric%20field.jpg?dl=0](https://www.dropbox.com/s/42o4gxbf2b69iho/Forminator%20Numeric%20field.jpg?dl=0)
 * If you can solve this issue that would be perfect, if not no problem i will follow
   your suggestions
 *  Plugin Support [Nebu John – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport14/)
 * (@wpmudevsupport14)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14839577)
 * Hi [@oreroy](https://wordpress.org/support/users/oreroy/),
 * That’s strange, I understand the issue from your screenshot but can’t replicate
   the same at my end.
 * Can you please let us know the device and browser details that you could replicate
   the issue on so that we can give it another try?
 * Looking forward to hearing back from you.
 * Kind Regards,
    Nebu John
 *  Thread Starter [oreroy](https://wordpress.org/support/users/oreroy/)
 * (@oreroy)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14839583)
 * I also cant replicate the issue, on my browser i can only enter numbers.
    But
   apparently spam software are able to ignore the numeric field rule.
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14840646)
 * Hi [@oreroy](https://wordpress.org/support/users/oreroy/)
 * Could you please try the following?
 * Add a hidden field, select user IP.
 * [https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#hidden-field](https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#hidden-field)
 * When you receive the new submission check this IP on Google or let us know the
   IP so we can verify if it is any reported spam IP on any site.
 * I also pinged our developers to verify the case and see how this could be happening.
 * I would suggest following my suggestions to prevent the issue as those are the
   best approach to add an extra security layer, but if you would like to keep this
   numeric field an alternative is this custom validation:
 *     ```
       <?php
   
       add_filter('forminator_custom_form_submit_errors', 'verification_for_number_field_extra_layer', 10, 3);
   
       function verification_for_number_field_extra_layer($submit_errors, $form_id, $field_data_array) {
   
       	  $forms = ['4777', '1020'];
       	  $field = 'number-1';
   
       	  // Skip if is not the correct form
           if( !in_array( $form_id, $forms ) ){
               return;
           }
   
       	  $number = (int) $_POST[$field];
   
       	  // double verification for number field
       	  if( $number !== 14 ) {
       	  	$submit_errors[][ $field ] = __( 'Please, enter the correct number' );
         	}
   
       	  // Always return $submit_errors
       	  return $submit_errors;
   
       }
       ```
   
 * You can add the code as a mu-plugin following this guide:
 * [https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins](https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins)
 * Add your form ID in the:
 * `$forms = ['4777', '1020'];`
 * This will convert to a number in PHP level and verify if the field is 14.
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14863871)
 * Hi [@oreroy](https://wordpress.org/support/users/oreroy/)
 * I hope you are doing well and safe!
 * We haven’t heard from you in a while, I’ll mark this thread as resolved.
 * Feel free to let us know if you have any additional questions or problems.
 * Best Regards
    Patrick Freitas

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

The topic ‘Numeric Field’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/numeric-field/#post-14863871)
 * Status: resolved