Number field in forms

All WYSIWYG Web Builder support issues that are not covered in the forums below.
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
Post Reply
trevorm
 
 
Posts: 84
Joined: Sat Mar 14, 2020 3:43 pm

Number field in forms

Post by trevorm »

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
User avatar
Pablo
 
Posts: 21719
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Number field in forms

Post by Pablo »

There is no standard solution for this in HTML as far as I know. This requires a custom script.
trevorm
 
 
Posts: 84
Joined: Sat Mar 14, 2020 3:43 pm

Re: Number field in forms

Post by trevorm »

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?
User avatar
Pablo
 
Posts: 21719
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Number field in forms

Post by Pablo »

There is no difference between the published HTML and local preview.
Maybe you did not publish all files?
User avatar
BaconFries
 
 
Posts: 5371
Joined: Thu Aug 16, 2007 7:32 pm

Re: Number field in forms

Post by BaconFries »

What does html of the input field look like?. What are the settings?

Code: Select all

<input type="number"............>
wwonderfull
 
 
Posts: 1277
Joined: Fri Aug 21, 2020 8:27 am

Re: Number field in forms

Post by wwonderfull »

If I am not misunderstanding then may be this can help:

Image

After that for validation this is extremely important:

Image

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.
trevorm
 
 
Posts: 84
Joined: Sat Mar 14, 2020 3:43 pm

Re: Number field in forms

Post by trevorm »

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.
User avatar
BaconFries
 
 
Posts: 5371
Joined: Thu Aug 16, 2007 7:32 pm

Re: Number field in forms

Post by BaconFries »

I think "Max Length" refers to the overall length of the number.
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...

<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})?$"
>
Post Reply