Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Text field populating drop down, that populates other text fields

anapashu
Level 1
Level 1

I have a form that intakes information to prepare documents with, and throughout the form the same data is collected multiple times. In the beginning portion, our client's children information is collected (name, phone number, address, etc) and the children can then later be selected to be beneficiaries or what not. After inputting the children information, I want to populate drop down menus that show their name, and if their name is selected, I want the corresponding fields with phone, address and what not to populate.

So for example, I have two Children:

John Doe, 555-555-5555, 123 Mayfield Drive

Ana Doe, 333-333-3333, 321 Juniper Street

So the drop down should populate John Doe, Ana Doe and also be able to type in any free-text (as they could pick someone else).

If someone is picked from the drop list, then the phone and address of that particular section should be populated with what was previously entered. If they freehand type, then all the other fields would be blank for them to free hand type.

Hopefully this makes sense.

1 Reply
paulk07
Level 6
Level 6

You can start with this:

Two text fields named child1 and child2.  When a name is entered in the text field(s) it then becomes available in the drop list.

I used the javascript below on the *pre-open event of the droplist.

this.rawValue = null;

this.clearItems();

this.addItem(child1.rawValue);

this.addItem(child2.rawValue);