Skip to main content
Known Participant
April 5, 2016
Answered

Text1 and Text2

  • April 5, 2016
  • 1 reply
  • 2783 views

hello

I have Text1 and Text2. i want If Text1 has the value >=2001 then Text2 will take the value 01(not 1 but 01).

Thanks

This topic has been closed for replies.
Correct answer try67

OK. First of all, make sure the Format option of Text2 is set to None and then use this code as its custom calculation script:

event.value = (Number(this.getField("Text1").value) >= 2001 ? "01" : "");

1 reply

try67
Community Expert
Community Expert
April 5, 2016

And if Text1 has a value smaller than 2001, or empty, what should Text2 be?

klothosAuthor
Known Participant
April 5, 2016

smaller than 2001 it does not apear

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 5, 2016

OK. First of all, make sure the Format option of Text2 is set to None and then use this code as its custom calculation script:

event.value = (Number(this.getField("Text1").value) >= 2001 ? "01" : "");