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

Retrieve data from DB w/o submitting CF page

Status
Not open for further replies.

vsimmons

Programmer
Jun 15, 2002
9
0
0
US
Hello,
I'm creating a form where the user will input a number into one of the form fields that uniquely identifies a person. In the database there are initials that are assigned to each ID. Once the user has entered the number and moves to the next field, I want to have the Initials field autopopulate with the initials from the database based on the number entered. I don't want to require the user to perform any additional functions (i.e. pressing a button) to make this data show up - I want it to happen automatically just like JavaScript field validation or something similar. Is this possible?
Thanks!
 
There are a few javascript solutions. You could do an onblur function that automaticaly submits the page to retrieve the initials, or when the page loads the first time you could fill a javascript array with all of the possible numbers and initials. That would populate the initials field without submiting, but anyone with any know-how could find out what all the possible numbers and initials are by viewing the source.
 
Depending on how many records you have in your database, you may be able to retrieve them all when loading the page initially. Then you could use a simple 'onBlur' command to populate the other fields when someone types in the right initials.

NOTE: Haven't actually tried this, just seems like it would be the best possibility for a not TOO large database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top