I have created a form on a page that requires the user to add a number in a field (set to Number field type ) with up to 2 decimal places. However, when published the field only allows whole numbers. I cannot see how to set the field to accept 2 decimal places
Should I use a different field type for this?
Thanks
Number field in forms
Forum rules
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
IMPORTANT NOTE!!
DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.
PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Re: Number field in forms
There is no standard solution for this in HTML as far as I know. This requires a custom script.
Re: Number field in forms
Hi Pablo,
Thanks for your reply.
When I test the page in Preview mode locally it works with decimal places, it just does not work when published online, why is that?
Thanks for your reply.
When I test the page in Preview mode locally it works with decimal places, it just does not work when published online, why is that?
Re: Number field in forms
There is no difference between the published HTML and local preview.
Maybe you did not publish all files?
Maybe you did not publish all files?
- BaconFries
-
- Posts: 5835
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Number field in forms
What does html of the input field look like?. What are the settings?
Code: Select all
<input type="number"............>
- wwonderfull
-
- Posts: 1550
- Joined: Fri Aug 21, 2020 8:27 am
- Contact:
Re: Number field in forms
If I am not misunderstanding then may be this can help:

After that for validation this is extremely important:

THIS WILL LOCK THE NUMBERS IN DIGITS AND USER CAN NOT LEAVE THIS AREA BECUASE IT IS CHECKED "DATA REQUIRED" MIN 1- MAX2 NUMBERS. BECUASE THE "DIGITS" ARE CHECKED ONLY NUMBERS CAN BE WRITTEN HERE NO TEXT CAN BE ENTERED.
If still it does not help please give a demo project and I will try to understand better.

After that for validation this is extremely important:

THIS WILL LOCK THE NUMBERS IN DIGITS AND USER CAN NOT LEAVE THIS AREA BECUASE IT IS CHECKED "DATA REQUIRED" MIN 1- MAX2 NUMBERS. BECUASE THE "DIGITS" ARE CHECKED ONLY NUMBERS CAN BE WRITTEN HERE NO TEXT CAN BE ENTERED.
If still it does not help please give a demo project and I will try to understand better.
Re: Number field in forms
Thanks for your input
I think "Max Length" refers to the overall length of the number. In fact the Number field type only displays whole numbers it appears, no digits following the decimal point. Although is does work in preview mode on my pc, it does not work online. I am uploading all pages and have even deleted all pages before uploading still with no change.
I think "Max Length" refers to the overall length of the number. In fact the Number field type only displays whole numbers it appears, no digits following the decimal point. Although is does work in preview mode on my pc, it does not work online. I am uploading all pages and have even deleted all pages before uploading still with no change.
- BaconFries
-
- Posts: 5835
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Number field in forms
You are correct with your thinking. Please try one of the following highlighted in red To insert ither right clickl on the Editbox->Object HTMl->Insert Tag. Please let me know if this helps...I think "Max Length" refers to the overall length of the number.
<input type="text" id="Editbox1" style="position:absolute;" name="Editbox1" value="" spellcheck="false"
step="0.2">
<input type="text" id="Editbox1" style="position:absolute;" name="Editbox1" value="" spellcheck="false"
pattern="^\d*(\.\d{0,2})?$" >