Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I populate a Form Field based on a drop down selection?

Status
Not open for further replies.

SteelDragon

Programmer
Feb 1, 2001
134
US
I have a drop down box that is dynamically populated with a query. It contains peoples names. I want to be able to select a name in that box, and have it automatically fill in a field below on the form with thier ID number. So every time I select a different employee on this form, their ID number changes in the text field below. Does anyone know how to do this? Do I make any sence?

SteelDragon
 
You could use javascript that runs when the dropdown selection changes. Dynamically build a javascript array with your query results. When the function is called have it fill in the text field. Does this make sense? Sorry I don't have any code for you right now.
Leslie
 
once your drop down selection is populated you can use onChange event to trigger reloading (new location) with all necessary information about your employee. you can use hidden form fields to pass data, and to make new query to get employee info and populate the form with new values; another way would be to use DHTML, and change the form fields using client side, but in this scenario you wouldn't be getting the best out of CF Sylvano
dsylvano@hotmail.com

"every and each day when I learn something new is a small victory..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top