Skip to main content
hondziiikh
Participant
September 21, 2018
Answered

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

  • September 21, 2018
  • 1 reply
  • 751 views

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 has been closed for replies.
Correct answer try67

Your code is unnecessarily complicated. Change it to:

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

1 reply

try67
Community Expert
Community Expert
September 21, 2018

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

hondziiikh
Participant
September 21, 2018

It is

Format is NONE

Password - NO

Check - NO

Multiline - NO

Roll long text - NO

Text formating - NO

character limit - NO (or 99)

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
September 21, 2018

Your code is unnecessarily complicated. Change it to:

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