• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
home/Knowledge Base/Common Issues & Troubleshooting/Number Field and decimals (floats)
Popular Search:Getting Started

Number Field and decimals (floats)

300 views 0 April 17, 2021 admin

Number Field and decimals (floats) - Easy Forms

Some browsers like Google Chrome pops up a validation error when we try to enter a decimal (floating point) number in a Number field and submit the form. Well actually it’s not a bug; the Number field is behaving as defined by the W3C.

Min and Step atrributes

The Number field can take additional settings “Min” and “Step”, which constrain the range of values allowed in your input.

  • The “Min” number is the minimum value your number can be.
  • The “Step” number controls the increase/decrease when clicking the up/down buttons on the field. For example, if you input the number 1 and click the up arrow, it will increase to 2. This is because the default step is 1.

However, the step attribute also determines which values are valid, so a step of 1 means you can enter 1, 2, 3 etc. and a step of 2 means you can enter 2, 4, 6 etc, and when you click the up/down buttons the number will increase/decrease by 2 each time, but entering 3 or 5 in the box will cause a validation error. You can also use a decimal value: for example, a step of 0.3 will allow values such as 0.3, 0.6, 0.9 etc, but not 1 or 2.

Number Field and Decimals (Settings)

Important! But what if you want all the numbers to be valid, integers and decimals alike? In this case, set Step to “any”. And if you want to accept all the integers and decimals (not centesimals), set Step to 0.1

And what if I want to accept only possitive numbers? Just set the Min number to 0.

Was this helpful?

Yes  No
Related Articles
  • Warning: session_start(): Failed to read session data
  • Install PHP Intl extension
  • Increase PHP memory limit
  • Update v1.* Forms to Make It Compatible with Easy Forms v2.*
  • Outgoing Emails are not displayed correctly
  • Referrer URL: Chrome, Edge, Firefox, and others browser show only the website domain

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

You must be logged in to post a comment.

Common Issues & Troubleshooting
  • Number Field and decimals (floats)
  • Warning: session_start(): Failed to read session data
  • Install PHP Intl extension
  • Increase PHP memory limit
  • Update v1.* Forms to Make It Compatible with Easy Forms v2.*
  • Outgoing Emails are not displayed correctly
View All 14  
Popular Articles
  • How to Show/Hide HTML elements with Conditional Rules
  • How to enable / disable DEBUG mode
  • How to Submit a Form as WhatsApp Message
  • How to update Form Stats from the command line
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  Outgoing Emails are not displayed correctly

Install PHP Intl extension  

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2024 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started