Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

pass drop down value to url

Explorer ,
Jun 19, 2006 Jun 19, 2006
Hi,
I have a dynamically created drop down box. I want to pass the selected value in the box to the URL, I'm stumped how to do this ? should I use js or can I do it without. I have the box in a form with a button. code below:

<code>

<form id="form1" name="form1" method="post" action="mainPage.asp">
<label for="select"></label>
<select name="select" id="select">
<%
While (NOT rsCategory.EOF)
%>
<option value="<%=(rsCategory.Fields.Item("category_id").Value)%>"><%=(rsCategory.Fields.Item("category_name").Value)%></option>
<%
rsCategory.MoveNext()
Wend
If (rsCategory.CursorType > 0) Then
rsCategory.MoveFirst
Else
rsCategory.Requery
End If
%>
</select>
</p>

<label for="Submit"></label>
<input type="submit" name="Submit" value="Display Products in this Category" id="Submit" />
</form>

</code>

I just want to ass the drop down/select value to the URL and post back to the same page for a recordset to collect the value and display the specified results.

Appreciate any feedback.
TOPICS
Server side applications
397
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 19, 2006 Jun 19, 2006
> I just want to ass the drop down/select value to the URL and post back to
> the
> same page for a recordset to collect the value and display the specified
> results.
>

I assume you mean "...Pass the drop..."!

The form is submitting to mainPage.asp - so it is getting ALL the values
from the form, and can parse out the <select> choice with -

Request.Form("select")

Is that what you mean?


--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"jsltd" <webforumsuser@macromedia.com> wrote in message
news:e75t45$agi$1@forums.macromedia.com...
> Hi,
> I have a dynamically created drop down box. I want to pass the selected
> value
> in the box to the URL, I'm stumped how to do this ? should I use js or can
> I do
> it without. I have the box in a form with a button. code below:
>
> <code>
>
> <form id="form1" name="form1" method="post" action="mainPage.asp">
> <label for="select"></label>
> <select name="select" id="select">
> <%
> While (NOT rsCategory.EOF)
> %>
> <option
> value="<%=(rsCategory.Fields.Item("category_id").Value)%>"><%=(rsCategory.Fields
> .Item("category_name").Value)%></option>
> <%
> rsCategory.MoveNext()
> Wend
> If (rsCategory.CursorType > 0) Then
> rsCategory.MoveFirst
> Else
> rsCategory.Requery
> End If
> %>
> </select>
> </p>
>
> <label for="Submit"></label>
> <input type="submit" name="Submit" value="Display Products in this
> Category" id="Submit" />
> </form>
>
> </code>
>
> I just want to ass the drop down/select value to the URL and post back to
> the
> same page for a recordset to collect the value and display the specified
> results.
>
> Appreciate any feedback.
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 19, 2006 Jun 19, 2006
If you want it in the URL on submit, you need to use method="GET " in your form tag. That is the easiest way.

Why does it need to be in the URL though?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006
thanks for the response. what would be your recommended method to acheive this if not using querystring ?
cheers.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 19, 2006 Jun 19, 2006
What scripting language are we talking?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2006 Jun 19, 2006
LATEST
asp vb

thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines