Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Scripting Sequential Numbers into textboxes

Avatar

Level 3

Hi,

Im trying to get a script for sequential number increament.

I've got 50 textboxes that have to be prefilled by sequential numbers based on the first textbox input.

So if I have 009 in textbox 1, I need 010 to appear in textbox2, 011 to appear in textbox3, 012 to appear in textbox4 etc until 050 in the last text box.

I have tried to use a read only calculation script to add "1" to each text box, however, the field does not have the same format as the first textbox with the zeros in front, so textbox 2 would have 10 instead of 010, textbox 3 would have 11 instead of 011.

Do you have any solution for me please? All I want is for the automatically calculated boxes to add up, using the same format as what is inputed in the first textbox.

thanks.

2 Replies

Avatar

Former Community Member

Decide on how many digits you want for your NumericField.

If you decide on 4, then in the display pattern for each field, make it num{9999}.

This will automatically add preceding zeros to other fields after your calculate event.

for ex, if 1 is entered in first field,

fields will be displayed as 0001, 0002, .....0013,0014,....

Hope this helps.

Regards,

Chaitanya

Avatar

Level 3

Hi Chaitanya,

thanks for your reply. However, I cannot determine the number of digits that would be inputed in the first box. What if they are two or more than four, then how do I set the display pattern? The digits in the first box would always be random.