?
Solved

Populating Text fields from dropdown choice

Posted on 2010-08-19
8
Medium Priority
?
220 Views
Last Modified: 2012-05-10
I have a table that I loop through to populate a dropdown list and I want to populate text fields with data based on what the user selects from the dropdown menu. The data I want to output in the textfields is not the same as the value set in the option fields, but does correspond with that row. Any help is much appreciated.
Thanks
0
Comment
Question by:csaexperts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33478528
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">
  function AssigntoTextBox(dropDown) {
   dropDown.parentNode.parentNode.childNodes[1].childNodes[0].value = dropDown.value;
  }
 </script>

     
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <asp:TextBox runat="server" ID="tbName" />

        <asp:DropDownList ID="ddlName" onchange="AssigntoTextBox(this)" runat="server">
      <asp:ListItem>AAA</asp:ListItem>
      <asp:ListItem>BBB</asp:ListItem>
      <asp:ListItem>CCC</asp:ListItem>
     </asp:DropDownList>

   
    </div>
    </form>
</body>
0
 

Author Comment

by:csaexperts
ID: 33484838
Thanks lucky85 for the help, tried the code which you have mentioned about but it didnt work.
Thanks
0
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33487222
It worked for me. What I did was, I had a drop down to a page and a text box. Now when ever a user changes the selection on the drop down that value will be apperead on the textbox. Are you looking something like this right?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:csaexperts
ID: 33567505
Not exactly; when the user selects from the dropdown menu. The data I want to output in the textfields is not the same as the value set in the option fields, but does correspond with that row.
0
 
LVL 4

Assisted Solution

by:docnica
docnica earned 2000 total points
ID: 33891407
Your in the coldfusion area, is that right? and if yes, do you need a flash form example or a bind example with html and ajax?
0
 

Accepted Solution

by:
csaexperts earned 0 total points
ID: 34069861
I think bind example with html and ajax would be great.
0
 

Author Comment

by:csaexperts
ID: 34714967
Able to solve the problem using ajax
0
 

Author Closing Comment

by:csaexperts
ID: 34759226
Able to solve the problem using Ajax
0

Featured Post

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question