Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#829785
I have a textbox field in a grid in ProcessMaker3.2.3 for getting float OR integer value from users. in the help of the validation property of this textbox, I select " An integer or decimal number" ([-+]?[0-9]+\.[0-9]+$) but when I enter an integer number in the textbox, I get an error. what should I do?
Attachments
Untitled.png
Untitled.png (2.21 KiB) Viewed 4555 times
#829788
kirkwg wrote: Fri Mar 11, 2022 4:06 am Try the following pattern matchings :
Integers or decimal numbers: ^[\-+]?\d*\.?\d*$
Number with up to two decimal digits: ^[\-+]?\d*(\.\d{0,2})?$
Number with exactly two decimal digits: ^[\-+]?\d*\.\d{2}$
Unfortunately, A zero is added to the first when I use getValue for this column of the grid to compare its value with a float textbox so returns false.
for example :
set 10.5 to this column >>> getValue output = 010.5
what should I do?
#829789
First, I don't know how you get a leading zero value?
if you enter 10.5, getValue() should get 10.5 not 010.5

Anyway, In this case use JavaScript parseFloat() to convert to a float value. e.g. like below:
var result = parseFloat($('#textID').getValue());

//similar as
alert(parseFloat('010.5')); //output: 10.5
#829790
kirkwg wrote: Fri Mar 11, 2022 11:18 am First, I don't know how you get a leading zero value?
if you enter 10.5, getValue() should get 10.5 not 010.5

Anyway, In this case use JavaScript parseFloat() to convert to a float value. e.g. like below:
var result = parseFloat($('#textID').getValue());

//similar as
alert(parseFloat('010.5')); //output: 10.5

With "parseFloat($('#textID').getValue());" the problem was solved. Thanks.

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]