ciberperson
Programmer
I have a page written in VBscript which allows a user to select from a dropdown, which passes a value to a SQL query. The results of the query are then displayed to the user. My customer does not like the GO button and wants an onChange or onClick event. Now I have to convert this part of the page to javascript. The problem is I don't know how to capture that value from the form and pass it to the SQL query using javascript. I've searched the Forum but haven't seen anything. Does anyone have some code sample I could use to understand the logic. Here's a snippet of what I have:
<form name=form3 method=get action="/folder/folder/contacts.asp">Complete Listings<br><Select name="picked-h">
<option></option>
<OPTION VALUE="S">All Sales Offices</OPTION>
<OPTION VALUE="D">All Distributors</OPTION>
<OPTION VALUE="R">All Manuf. Reps</OPTION>
<OPTION VALUE="H">Headquarters</OPTION>
</select>
<input type="submit" name="G3" value="Go"></form>
later...
<% getH = Request("G3"
If getH="Go" then
strHQ=Request("picked-h"
set rsC = Server.CreateObject("ADODB.Recordset"
strQuery = "select * from sales_contacts where TYPE = '" & strHQ & "'"
rsC.Open strQuery, objConn
End if
%>
From here, the recordset is displayed in a table and the user is happy. Everything is dimmed and runs great in VB. Can anyone point me in the right direction? Thanks
<form name=form3 method=get action="/folder/folder/contacts.asp">Complete Listings<br><Select name="picked-h">
<option></option>
<OPTION VALUE="S">All Sales Offices</OPTION>
<OPTION VALUE="D">All Distributors</OPTION>
<OPTION VALUE="R">All Manuf. Reps</OPTION>
<OPTION VALUE="H">Headquarters</OPTION>
</select>
<input type="submit" name="G3" value="Go"></form>
later...
<% getH = Request("G3"
If getH="Go" then
strHQ=Request("picked-h"
set rsC = Server.CreateObject("ADODB.Recordset"
strQuery = "select * from sales_contacts where TYPE = '" & strHQ & "'"
rsC.Open strQuery, objConn
End if
%>
From here, the recordset is displayed in a table and the user is happy. Everything is dimmed and runs great in VB. Can anyone point me in the right direction? Thanks