8 Replies Latest reply on Jan 22, 2009 1:19 PM by clbeech

    Input text to Dynamic text box with responses

      I have to create a demo of a "Tech Support" app.

      I have one input text box, one dynamic text box and a submit button.

      when a user types into the input text box, then presses the submit button their "question" will appear into the dynamic text box.

      All of this functions the way it should outside of one thing. I need to be able to have the user enter in multiple questions. Right now if they first type in "fried chicken" and press submit, then enters in "pizza" and presses submit again the text displayed in the dynamic text box should show two lines:

      fried chicken

      but instead every time a user presses submit the text is overwritten (i.e. "fried chicken" is overwritten by "pizza" on same line).

      So here's the code so far:
      //code block
      questionTxt.text = "enter your tech support query here.";
      questionTxt.onSetFocus = function()
      this.text = "";

      displayTxt.text = "Technical Support: Hello. How can I help you?";
      displayTxt.onSetFocus = function() {
      this.text = "";

      var i=1
      var responseTxt = "Thank you, one moment please.";

      this.submitBtn.onRelease = function(){
      output = "Dr. Smith: " + input + "\n" + responseTxt + "\n";
      questionTxt.text = "";
      // end code block

      So the end result should be:

      User enters in "I have a question" and presses submit
      dynamic text box shows "Dr. Smith: I have a question" and below that "Thank you, one moment please"
      -->this happens currently

      User enters in ANOTHER question "I also need info on...." and presses submit
      Dynamic text box shows:

      Dr Smith: I have a question
      Thank you, one moment please.

      Dr Smith: I also need info on...
      Thank you, one moment please.


      My guess is that I need to use the "input" variable from the input text box for each line but not too sure how to.

      Any suggestions would be greatly appreciated. Thanks!