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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get the information on my

Status
Not open for further replies.

robman22

Programmer
Nov 28, 2000
12
CA
How can I get the information on my form(from my database) to change to the data relevant to my selection from my dynamic select box? For example: when I select Joe, I want to see Joe's info, and when I select Jane, I want to see Jane's. On the same form of course.
 
I did this when I was in the Air Force. We had a list of employees. If you wanted to change any of the information for a particular employee you would select their name from the list and it would take you to a big form with all of their information in various form fields. You change what you want, keep the rest as-is and hit submit.

Just select a name (and associated ID,) pass it to the page with the form and run a query to retrieve that person's information:

Code:
SELECT *
FROM Employees
WHERE Employee_ID = 'YourEmployee'

Once you have that info, you can put it into your form fields like so;

Code:
<INPUT TYPE=&quot;text&quot; NAME=&quot;fname&quot; VALUE=&quot;#fname#&quot;>

Hope this is what you were after.

Kevin
 
Not really. I was wondering if I could select the item and have it populate the same form.

Thanks for your response.
 
I don't see why not. Rather than select the item and pass it to another page like mine did, just select the item and use it later in the same page. Should work.
 
I too am a big fan of the &quot;rollover&quot; form. In very rare cases I post forms to &quot;other&quot; pages, but for the most part, I like to stuff it all into one template.

The tricks you will need to master are:

Always name your variables the same as your &quot;columns&quot;

Use CFPARAM to provide a default for every variable

Use action=&quot;#GetFileFromPath(GetCurrentTemplatePath())#&quot; in your forms so you cut/paste them or rename the file and they still work.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top