I have a form that has a table that contains a textbox where the user inputs a part number. Depending on what the user enters, when the user tabs to the next textbox, I want it to go to the database and search for the number that was entered.
-----------------------------------------------
okey, what has to happen is the page has to refresh. using a javascript command you can submit a form. I suck at javascript, but this is what has needs to happen (resemblance to actual code will be minimal)
OnLostFocus of form.searchfield {
if search field is not empty then submit form
}
Say your page is search.cfm .. the forms action is set to "search.cfm". At the top of the page you setup a little block of code:
<cfparam name = "pagestate" value = "load">
<cfif pagestate eq search> RUN THE QUERY HERE </cfif>
In the form you include a hidden field called pagestate value="search". So when you js function kicks the form back to the server, it will run your search. Then you use the result of the query to populate the other fields if it returns any info about the part.