Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Populate several text fields with one entry

Avatar

Former Community Member
Is it possible to have a user enter text (for example, their name), and have the text automatically populate several other 'name' fields in the form, without having to script all of the other fields with something like "$.rawValue = EEInfo.EEName.rawValue"?
8 Replies

Avatar

Former Community Member
I would also like to hear a solution for this question as I am creating several forms that will have repeating information at times on additional pages. I have tried several methods but so far I'm way off on a solution. If there is a sample somewhere I so far have been unable to locate it.



Thank you.

Avatar

Former Community Member
You could use more brief syntax. For example, if you have a field called 'name' on page 1, and a second field on page 2 called 'name2', then on page 2 on the field 'name2', you simply do the following:



1) Make it "calculated - read only)"

2) use formcalc

3) in the calculated event, just type 'name'. That is, you don't need the equal sign or the rawvalue property. (note, if you named your pages, then you might have to type 'P1.name', if your page 1 name is called 'P1'.

Avatar

Level 7
I would suggest using the zero based page numbering scheme for pages in variable names. This means the page would be zero. With this method one need only get the JavaScipt page number to programatically build the field name.

Avatar

Former Community Member
Scott,



Thanks; while still requiring duplicating the scripts, it does make the code a bit more efficient.



Chris

Avatar

Former Community Member
Thank you for your quick reponses.



I did all that you said and got an error message that

Script=Name

Error: accessor 'Name' is unknown



'Name' is the name of the field that I want to duplicate. Obviously I'm very new to this language but that is one of the things I did try before. I am not sure where to go to give the pages names... there are only 2 so far.



Thank you

Avatar

Former Community Member
Thank you so much! I got it to work and it works for 3 fields and I feel like a superstar! I'm getting the gist of what's expected here and I can't thank you enough for steering me in the right direction!!

Avatar

Former Community Member
There actually is a better way to do this. Read the Designer help on Global fields. This is exactly what you were originally looking for.

Avatar

Former Community Member
PERFECT, absolutely perfect! Thanks for pointing me in the right direction!