Title: Number field warning
Last modified: September 4, 2018

---

# Number field warning

 *  Resolved [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/number-field-warning/)
 * I have a Number field where I like to have the folowing rule:
 * When the number is not divisible by 5 there must be a warning text displayed 
   in the Number field instead of the number.
 * (for example: the number must be 5,10,15,20,25,30,35,40 and so on..)
 * How can I do that?
 * Thank you!
    Alwin
    -  This topic was modified 7 years, 11 months ago by [Alwin](https://wordpress.org/support/users/wp-opti/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fnumber-field-warning%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/number-field-warning/#post-10655215)
 * Hello [@wp-opti](https://wordpress.org/support/users/wp-opti/),
 * You cannot display a text into the number field, because this value would be 
   violating the validation rule that checks if it is a number or not.
 * An alternative would be insert a HTML Content field in the form for checking 
   the value of the number field, and force its value to the next multiple of 5.
   Assuming that the number field is the fieldname1, a possible code would be:
 *     ```
       <script>
       jQuery(document).on('change', '[id*="fieldname1_"]', function(){
           var v = this.value;
           if(v%5 != 0)
           {
               v = CEIL(v,5);
               jQuery(this).val(v).change();
           }
       });
       </script>
       ```
   
 * I’m sorry, but this behavior is specific to your project, if you need additional
   help with a custom feature not included by the plugin, I can offer you a custom
   coding service from my private website:
 * [https://cff.dwbooster.com/customization](https://cff.dwbooster.com/customization)
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Number field warning’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

## Tags

 * [number field](https://wordpress.org/support/topic-tag/number-field/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/number-field-warning/#post-10655215)
 * Status: resolved