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

Reference Form Field Value for URL

Guest
May 02, 2006 May 02, 2006
This is an easy one, I know. But the few things I've tried haven't worked.

I have a form with a List/Menu and a button. The field is a list of Instruments:

<td class="Text"><select name="Instrument" class="Text" id="Instrument">
<option value="Acoustic Guitar" selected="selected">Acoustic Guitar</option>
<option value="Bass Guitar">Bass Guitar</option>
<option value="Drums">Drums</option>
<option value="Electric Guitar">Electric Guitar</option>
<option value="Harmonica">Harmonica</option>
<option value="Keys">Keys</option>
<option value="Mandolin">Mandolin</option>
<option value="Other">Other</option>
<option value="Percussion">Percussion</option>
<option value="Piano">Piano</option>
<option value="Violin">Violin</option>
<option value="Vocal">Vocal</option>
</select></td>

When the user clicks the button to submit the form (named form2), I have the button sending the user to another page. I need the URL to have the selected value from the list as the last parameter. I have:

<form id="form2" name="form2" method="post" action="AddMusician.asp?eventid=<%=EventInfo("EventID")%>&Instrument=<%Response.Form("Instrument")%>" />

And everything works except the Response.Form command. The button works, the URL appears with nothing after the Instrument=. I also tried setting the field to a variable (strInstrument) and using this:
<%
Dim strInstrument
strInstrument = Request.Form("Instrument")
%>

<form id="form2" name="form2" method="post" action="AddMusician.asp?eventid=<%=EventInfo("EventID")%>&Instrument=<%Response.Write strInstrument%>" />

Thanks for your help.

Rob
TOPICS
Server side applications
282
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 ,
May 02, 2006 May 02, 2006
All server side processing takes place when the user receives the form.
There's no way for anything to appear in the URL there because nothing has
been selected yet. Only AddMusician.asp receives that information since
it's the page that receives the form when it's submitted.

If you want everything in the URL, switch your form method to GET instead of
POST.

"robmoulton" <webforumsuser@macromedia.com> wrote in message
news:e3825r$lqp$1@forums.macromedia.com...
> And everything works except the Response.Form command. The button works,
> the
> URL appears with nothing after the Instrument=. I also tried setting the
> field
> to a variable (strInstrument) and using this:
> <%
> Dim strInstrument
> strInstrument = Request.Form("Instrument")
> %>
>
> <form id="form2" name="form2" method="post"
> action="AddMusician.asp?eventid=<%=EventInfo("EventID")%>&Instrument=<%Respo
> nse.Write strInstrument%>" />
>

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
Guest
May 02, 2006 May 02, 2006
LATEST
That's what I needed. 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