Welcome to WebmasterWorld Guest from 188.8.131.52
Note: I'm using Dreamweaver CS4.
I'm having an issue on my web page trying to figure out how to get this done. I have a repair log web page I created and this is the only part left. We have a text field up top that the operator would input the last 6 digits of a vehicles VIN# and then click the button. It should then lookup in my database the entire 17 digit vin number and put it in the VIN text box. I have a picture I'm including to show you how it is setup and the code behind it.
I'm not sure if I'm on the right track but I've created a recordset in DW and it functions. The recordset goes to my DB table and searches for "ends with" the 6 digits of the vin. When I've got the recordset box open and click the "TEST" button where it has you input a value to see if it work, it works beautifully. In the test return it shows the whole vin number. The problem is, I have no idea what to do at this point.
I don't know how to:
1. Link the recordsets' lookup information to the text box that would contain just the 6 digits.
2. Link the recordset to activate by hitting the "Get Full VIN" button
3. Link the recordset to use the Full VIN text box as where it should output the result.
If anyone can help with this stuff I would GREATLY appreciate it!
[edited by: mack at 8:47 pm (utc) on Feb. 4, 2009]
[edit reason] Removed image link, thanks! [/edit]
I have created a session variable called vinlook. I have set the first text box linked to this vinlook. I then modified the recordset to look for the session variable vinlook. I'm not sure how to make a button activate this lookup now. When I load the page to view it, it now just automatically posts the first VIN# from the table in the result box without even inputting any value. So apparently the recordset activates when the page loads but the search box is empty so I'm not sure why it is showing the first value in the DB table with a blank entry box. Any suggestions?
[edited by: Sid3ways at 8:46 pm (utc) on Feb. 5, 2009]
The thing to get your head around is what happens on the server, and what happens in the browser. An ASP page is executed on the server, then the resulting HTML is sent to the browser. There is no connection from the HTML page to the ASP or recordset on the server, ASP just generates the raw HTML and sends it to the browser.
Once the HTML is sent the recordset no longer exists, and even if it did exist the browser can't connect to it because it's on the server and there's no connection from browser to server. ASP just generates and sends "normal" HTML pages.
So, to populate the full VIN text box with a partial value entered in a HTML form, you must send the partial value to an ASP page on the server, which then queries the database and sends the full VIN in the HTML it returns.
There's two ways of doing this:
1. Easiest way: user enters partial VIN, clicks "Get Full VIN" button that submits to the server ASP, which then looks up the full VIN, and returns the same page but now with the looked up full VIN in the <input value="here">.
You could do this as two pages: first page for just partial VIN input and "Get Full VIN" button, which submits to a second page with the full VIN and all the other inputs.