Populate Text Field Based On Drop-Down List Selection | Community
Skip to main content
June 12, 2006

Populate Text Field Based On Drop-Down List Selection

  • June 12, 2006
  • 22 replies
  • 81589 views
I'm trying to set up a form so that a text field will populate with default text (that could later be edited by the end user) based on a users previous drop-down selection.



For example:



The end user is putting together a proposal for a client and is able to choose the type of proposal or service from a drop-down list. Once the user makes a selection from the drop-down list a text field is populated with default text describing the service.



The only catch is that the end user would need to be able to edit the default text. An example would be if an individual purchased a car but all the specific features and/or accessories could be added into the default text as necessary based on the purchasers desired upgrades. The common or universal features of the car would, however, show up as the default text.



Would this scenario be possible through the use of XML? Any tips on how I can accomplish this would be much appreciated.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

22 replies

August 28, 2008
Hi Redcoat,



Were you able to figure out how to make the second list a drop down menu?



Thanks, Justin
August 30, 2008
Dear Stefan



Ref. you post above, I am trying to do a similar thing but no vain. Would you please help me?



I have a form where I have drop down list menu named as "Country" it shows names of many countries then I have another drop down list box with the name "cities" which has name of many cities....



In both of the above fields I have manually entered the names of the countries and cities respectively in the designer.



what I want is that when i select the specific country then all cities related to the country only show up in the "cities" drop down list box?



Is this possible in forms? I am using Life Cylce ES 8.2



please advise

Asim
September 4, 2008
I'm using Stefan's original example which is exactly what I am looking for but I'm having trouble moving the text field to a different page than the drop down. I want the user to select from the dropdown on page 1 and have that populate text fields on other pages. Is there additional script involved?
September 5, 2008
I'm also trying to have it populate multiple text fields across multiple pages.
September 16, 2008
Greetings,



I've figured out how to string together different text and numeric fields into a single text field. My question is - is there any way i can have the results sent as a text message to a mobile phone? I simply want to send simple text to a mobile phone number.



Any ideas?
September 18, 2008

September 18, 2008
I am not sure this is what you are looking for but this is the script behind the drop down on change event and InsertNote1 is the text field being populated. The text field is also set to Calculated - Allow User Override.



var sNewSel = this.boundItem(xfa.event.newText);

var bEnableTextField = true;



switch (sNewSel)

{

case "1": // Option 1

InsertNote1.rawValue = "Text if option 1 is selected.";

break;



case "2": // Option 2

InsertNote1.rawValue = "Text if option 2 is selected."

break;



case "3": // Option 3

InsertNote1.rawValue = "Text if option 3 is selected."

break;



case "4": // Option 4

InsertNote1.rawValue = "Text if option 4 is selected."

break;



case "5": // Option 5

InsertNote1.rawValue = "Text if option 5 is selected."

break;



case "6": // Option 6

InsertNote1.rawValue = "Text if option 6 is selected."

break;



case "7": // Option 7

InsertNote1.rawValue = "Text if option 7 is selected."

break;



case "8": // Option 8

InsertNote1.rawValue = "Text if option 8 is selected."

break;



default: // unknown value -- do nothing

bEnableTextField = false;

break;

}



if (bEnableTextField)

{

InsertNote1.access = "open"; // enable field

InsertNote1.caption.font.fill.color.value = "0,0,0"; // set caption to black

}
November 3, 2008
I am trying to populate text fields with the same information, such as the name, address, and phone number. I want to know if there is way that I can do so, without having to use any outside coding. I don't need to populate complex information, just the basic. I guess my main purpose is to have that simple information populate throughout a form without having re-type such information throughout my 4-6page forms. Leaving me with less room for error.
Level 8
November 3, 2008
If you are going to set another field's value from a combo box or list you need to use some form a scripting.
February 6, 2009
Hi how to generate the text field with the selection of an item in the combo box please help me if any one knows