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

event for a select box

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have the following select box. It will retrieve a list from my database, but I can't figure out how to fire off an event once a selection is made.

I need the user to make a selection from the box, and then
use that selection place the search text in a url something like:
FROM DROP DOWN.

I guess Id have to put a button beside the drop down and do some kind of on_click, but Ive tried a couple of ways and cant make any progress.

thanks for any help...
*************************************
Select Unit:
<%
dim cboconn
dim cbors
dim cbosql
Set cboConn = server.CreateObject(&quot;Adodb.Connection&quot;)
cboConn.Open &quot;Provider=MSDAORA;Data Source=Live; &quot; &_
&quot;User ID=xxx;Password=xxx;&quot;
cboSQL = &quot;Select distinct living_unit_code1 from v_living_units&quot;
set mData = cboConn.Execute(cboSQL)
Response.write &quot;<select name=Unit>&quot;
Do while not mData.EOF
Response.write &quot;<option value=&quot; & mData(&quot;living_unit_code1&quot;) & &quot;>&quot; & mData(&quot;living_unit_code1&quot;)
mData.MoveNext
Loop
Response.write &quot;</select>&quot;
%>
 
<%
dim cboconn
dim cbors
dim cbosql
Set cboConn = server.CreateObject(&quot;Adodb.Connection&quot;)
cboConn.Open &quot;Provider=MSDAORA;Data Source=Live; &quot; &_
&quot;User ID=xxx;Password=xxx;&quot;
cboSQL = &quot;Select distinct living_unit_code1 from v_living_units&quot;
set mData = cboConn.Execute(cboSQL)
Response.write &quot;<select name=Unit onchange='SubmitMe(this)'>&quot;
Do while not mData.EOF
Response.write &quot;<option value=&quot; & mData(&quot;living_unit_code1&quot;) & &quot;>&quot; & mData(&quot;living_unit_code1&quot;)
mData.MoveNext
Loop
Response.write &quot;</select>&quot;
%>

Add the following javascript to the page
<script language=javascript>
function SubmitMe(theField)
{
window.location=&quot; + theField.value
}

</script>
 
thanks, Ill give that a try this morning and see if I can make it work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top