Expand my Community achievements bar.

Can LC make a dynamic form generate extras fields as needed?

Avatar

Level 2

I'm creating a form for clients that requires them to list every state they have locations in (and a few factors for each state). Obviously I dont want to have 50 fields crowding the form when most clients only have one state to list, but I don't want to restrict the clients to only 4 or 5 when they may just have 20!

I tried just using an expanding text field for each factor and having them hit enter for each new state, but it is confusing to use and doesn't deliniate between answers well. I need a line between each entry!

Currently the fields for each state are in a table with a row for each factor. Is there a way to allow the person using the form to hit a button or hit enter and generate a new table of fields for a new state, so they could add exactly as many as they needed? (A delete last field function would be great as well!)

Answerers keep in mind I'm not awesome with generating my own XML, but I can copy and paste chunks of code just fine

4 Replies

Avatar

Former Community Member

Why not have then enter in the States separated by a comma and on exit we could write a little script that will put a newline in between?

Maybe I am not undertsanding your request properly.

Paul

Avatar

Level 2

I think that wouldnt work because they have to put in lots of info for each state. Here is an example of what the field looks like now.

Avatar

Former Community Member

How about if we do something like this. The user woudl have to click the add button for each state.

Paul

Avatar

Level 2

Hey, that works great, and I can repeat the good results in other forms- thanks for the help Paul!