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

Client Side to Server Side 1

Status
Not open for further replies.
Nov 29, 2001
72
US
I need a way to pull a value from a drop down box client side and somehow make it available for server side script.

I am already able to retrieve the value from the drop down box using the "onChange" method, but I need to be able to make that value available for some server side script to retrieve values from SQL to build another drop down box.

Is this even possible?

Thanks in advance,
Dave
 
You can use ASP to do this.

You have your client side pulldown with the onChange function form like so:

---formpage.htm---
<form name='myform' action='process.asp' method='post'>
<select name=mychoice onChange='document.myform.submit()'>
<option></option>
<option value=1>Pick Me!!</option>
<option value=2>No Pick Me!!</option>
<option value=3>No Pick Me Please!!</option>
</select>

---process.asp---
<%@ Langauge=VBScript%>
<%
Dim UserChoice, SQL
SQL = &quot;&quot;
UserChoice = 0

UserChoice = Request.Form(&quot;mychoice&quot;)
SQL = &quot;select * from table where id =&quot; & UserChoice
'run the SQL against your DB using ADO.
%>


Hope that helps!!
Mark


 
dont forget your </form> on the client side!!!!!
 
Thanks for your help Mark. I don't think I made clear in my original post what it is I am attempting to do.

After the user makes a selection from the drop down box, I would like to be able to take that value, do a select from SQL and build the list for an adjacent drop down box.

It would be great if I could somehow do a response.redirect from client side scripting once I retrieved the changed value. Is this possible?

Thanks,
Dave
 
Thanks for the tip Jon! I believe that is exactly what I was looking for. I will see if I can get it to work for me.

Thanks again,
Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top