Skip to main content
hondziiikh
Participant
Sep 21, 2018 7:37 AM UTC
Answered

Is there any limit in var, if var is number?

Hallo, i've two simple inputs named "Text1" and "Text2". And javascript on unfocus from Text1.

Javascript here:

var text = "";

var barcode = "";

text = getField("Text1").value;

barcode = getField("Text2");

barcode.value = text;

It's works fine. But when i fill Text1 with long number (16digits), Text2 becomes strange, by the table below

Text1       
goes to       
Text2
9203803018350709        
9203803018350708
9203803018350708        
9203803018350708
9203803018350707        
9203803018350708
9203803018350706        
9203803018350706
9203803018350705        
9203803018350704
9203803018350704        
9203803018350704
9203803018350703        
9203803018350704
9203803018350702        
9203803018350702
9203803018350701        
9203803018350700
9203803018350700        
9203803018350700

Any ideas how to solve please?

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Sep 21, 2018 9:31 AM UTC

Your code is unnecessarily complicated. Change it to:

event.value = this.getField("Text1").valueAsString;

6 replies

try67
Community Expert
Community Expert
Sep 21, 2018 8:55 AM UTC

Set the fields' Format to None, not to Number.

Translate
hondziiikh
Participant
Sep 21, 2018 9:14 AM UTC

It is

Format is NONE

Password - NO

Check - NO

Multiline - NO

Roll long text - NO

Text formating - NO

character limit - NO (or 99)

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Sep 21, 2018 9:31 AM UTC

Your code is unnecessarily complicated. Change it to:

event.value = this.getField("Text1").valueAsString;

Translate