tonyrampedi / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
0 stars 0 forks source link

Float value can't contain numpad decimal character #111

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a textfield with the float=>1 property
2. On the numeric part of the keyboard, type a float number, eg 123.45

What is the expected output? What do you see instead?
You expect the decimal value 123.45, but the numpad decimal (.) isn't shown, 
instead it shows 12345. Only the "normal" decimal value is accepted.

What version of the product are you using? On what operating system?
Using version 1.1.4 on a XAMMP installation under Windows 7 and the same 
version on my Linux hosting. Script tested with Windows 7 using IE8, Chrome 9 
and FF3.

Please provide any additional information below.
In class.form.php line 2857 you can extend the line:
> var pfbc_allowed_keys = [8, 9, 13, 37, 39, 46];
to the following:
> var pfbc_allowed_keys = [8, 9, 13, 37, 39, 46, 110];

This enables the (numpad) decimal point, but only under Windows. If you want to 
enable this on Mac and Linux, you have to add 65 and 83 as well. But the issue 
then is that under Windows, you can also add the character S to the float box, 
since the keyboard layout is different for all OS-es.

See this link for a keyboard layout for different OS-es: 
http://classicteck.com/rbarticles/mackeyboard.php

Original issue reported on code.google.com by fetchy...@gmail.com on 28 Feb 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Thanks for providing this detailed bug report.

- Andrew

Original comment by ajporterfield@gmail.com on 14 Mar 2011 at 3:11