Retrieving Combobox value in ASP

  • Thread starter Thread starter JC
  • Start date Start date
J

JC

Hi,

I am having a very difficult time retrieving the value of the selected
item in the combo box using ASP. I have the following code, that
refreshes the page location when the combo box selection is changed.

<SELECT NAME="optionvalue"
onChange="document.location='/input.asp?optionvalue=<% =optionvalue
%>'">

The problem is that the variable optionvalue is never passed in the
URL, and I always end up with the same URL which is
'/input.asp?optionvalue='

If I replace the ASP statement with something like <% =int(rnd*10) %>
then it works fine, and the correct URL is formed, i.e.
'/input.asp?optionvalue=6'.

How can I go about resolving this issue? I am sure the solution is
very simple, but I have been trying for hours with little success.

Any help will be appreciated. Thanks in advance.

JC
 
Is this part of a complete form, if so, then just do a post to input.asp and then on input.asp
retrieve the form value for optionvalue as:

<%
Dim ov
ov = request.form("optionvalue")
%>

Then use ov to display or as the look up value for a query

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top