Form question

  • Thread starter Thread starter Michael Stumpo
  • Start date Start date
M

Michael Stumpo

I am playing around with form buttons and I have a form
button that I want to use to open a page.

The code I have works fine:

<form method="GET" action="licenses_select_r.asp">
<p><input type="submit" value="Software Licenses"
name="B1"></p></form>.

When the page loads the URL displays:

http://localhost/webname/admin/licenses_select_r.asp?
B1=Software+Licenses.

Why does the ?B1=Software+Licenses show up? All I would
prefer to display is the page name (licneses_select_r.asp

Is there some code I have to enter to get the URL more
clean.

-M
 
That's typically what happens when a name is attributed to an submit button.
The submit button, when pressed, will also submit to the form. Since you're
using the GET method, this will always appear in the URL since that's how
the Get method handles information, appended to the URL as a querystring. If
you were using the POST method, the same information would be submitted to
the form, but none of the form fields would appear in the URL's querystring.

Unless you really need to use the Get method, you can change this to POST
and get rid of the querystring.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Hi,
you're submitting this as a form so it includes the name and value of the
input button B1=Software+Licenses.

You could either do this
<form method="GET" action="licenses_select_r.asp">
<p><input type="submit" value="Software Licenses"></p></form>.
or more usually
<form><p>
<input type="button" value="Software Licenses"
onclick="location.href='licenses_select_r.asp';">
</p></form>.
 
Back
Top