Results 1 to 7 of 7

Thread: Populate Text Field Based On Drop-Down List Selection

  1. #1
    Join Date
    Apr 2010
    Posts
    88

    Populate Text Field Based On Drop-Down List Selection

    I am trying to build an application that will automatically populate that text field on the bases of users previous selection in the drop down list. The main thing would be that on the bases of item that a user will select from the drop down list the text field will automatically filled but the user should be allowed to edit those field. For example if a user selects a car then all the field related to the accessories will be filled but if the user wants to change the list of accessories then he can change those list. I just want to know how to Populate Text Field Based on Drop-Down List Selection?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Populate Text Field Based On Drop-Down List Selection

    If I am not wrong then you want to populate the text field on the bases of the user selection, but the thing is that if you want to populate the field with the predefined value then it will be easy but if you want to populate the field dynamically then it will be a bit difficult. If you are having the pre defined values with you then you can use simple scripting language for doing that.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Populate Text Field Based On Drop-Down List Selection

    For doing the things that you want to achieve you need to write a scripting code in the change event of drop down list.
    Code:
    var ListSale = this.boundItem(xfa.event.newText);
    
    switch (ListSale)
    
    {
    
      case "1": 
        TextField1.rawValue = "fundamental accessories:\n- frame\n- wheels\n- glass";
    
        break;
    
      case "2": // different things
    
        TextField1.rawValue = " fundamental accessories..."
    
        break;
      default: 
        break;
    
    }
    Try to write this code and after that if you face any difficulty then feel free to ask about it.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Populate Text Field Based On Drop-Down List Selection

    Through the use of Adobe LifeCycle Designer for the Adobe, and I am trying to fill the text field with use of multiple entries through the drop down list. I have managed to fill the text field on the bases of selection in the dropdown list but I am facing difficulty in maintaining things, when I am selecting item from the list the previous entries from the field are misplaced, and I need to maintain all the things.

  5. #5
    Join Date
    Feb 2010
    Posts
    181

    Re: Populate Text Field Based On Drop-Down List Selection

    You are trying to use the dropdown list or simple list, but the thing is that these two things does not support the multiple selection. In place of list you need to use the combo box for achieving the task. Combo box supports the multiple selection but for that the property of multiple selection should be activated. Try to use combo box and set the multiple section property to true.

  6. #6
    Join Date
    Feb 2010
    Posts
    524

    Re: Populate Text Field Based On Drop-Down List Selection

    I created a drop down menu which recuperates the fields of a table and displays them. I also have a description text box in my page. I saw what happened when a user selects a choice by clicking the drop down menu, it sees automatically receive the description (stored in the database) associated to this choice. So should I get the choice then I make an application to display the description associated with the selected choice on the text area automatically. Any related reply will be appreciated.

  7. #7
    Join Date
    Feb 2010
    Posts
    129

    Re: Populate Text Field Based On Drop-Down List Selection

    You store the elements of your table into a variable $ dir.
    echo '<a href="?details=1"> detail to see a link </ a>';
    if ($ _GET ['details'] == 1) echo $ dir ['details'];
    and by default, you put details to 0. If that does not work for you then take an application in the field and its description from sql and create a table in javascript. And use a javascript function on the 'onChange' down menu to update the text "description" by getting the proper description in the table javascript.

Similar Threads

  1. Replies: 2
    Last Post: 21-02-2012, 07:48 PM
  2. Add/remove programs will not populate list
    By Chucky in forum Windows XP Support
    Replies: 4
    Last Post: 25-10-2011, 08:36 PM
  3. Replies: 1
    Last Post: 09-09-2011, 03:38 PM
  4. Combobox Selection To Populate Listbox
    By mellisahi in forum Software Development
    Replies: 3
    Last Post: 06-06-2009, 10:38 PM
  5. Populate a Drop down list in php from SQL
    By GunFighter in forum Software Development
    Replies: 2
    Last Post: 18-03-2009, 09:08 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,523,617.71681 seconds with 17 queries