Hyperlink from drop-down box - is this possible?

L

Linda D

I have a drop down box that is populated using the database results wizard
(into an Access database). How can I use the selection to jump to another
page? There doesn't seem anywhere I can hyperlink although if I bring the
results back as a list this can be achieved.
 
S

Steve Easton

This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
L

Linda D

I also need to hyperlink to an .asp with parameters based on the selection.

Steve Easton said:
This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

Linda D said:
I have a drop down box that is populated using the database results wizard
(into an Access database). How can I use the selection to jump to another
page? There doesn't seem anywhere I can hyperlink although if I bring the
results back as a list this can be achieved.
 
J

Jon Spivey

Hi Linda,
To add parameters you'd use a form - something along these lines
<form method="get" action="page.asp">
<select name="ProductId">
<option value="1">Widgets</option>
<option value="2">Grommets</option>
etc....
</select>
</form>
Then you can retrieve the paramater with
<%
intProductId = request.querystring("ProductId")
%>

--
Cheers,
Jon
Microsoft MVP

Linda D said:
I also need to hyperlink to an .asp with parameters based on the selection.

Steve Easton said:
This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

Linda D said:
I have a drop down box that is populated using the database results
wizard
(into an Access database). How can I use the selection to jump to
another
page? There doesn't seem anywhere I can hyperlink although if I bring
the
results back as a list this can be achieved.
 
T

Thomas A. Rowe

I think Jon meant to write

intProductId = request.form("ProductId")

instead of

intProductId = request.querystring("ProductId")

since this is a form.


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

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


Jon Spivey said:
Hi Linda,
To add parameters you'd use a form - something along these lines
<form method="get" action="page.asp">
<select name="ProductId">
<option value="1">Widgets</option>
<option value="2">Grommets</option>
etc....
</select>
</form>
Then you can retrieve the paramater with
<%
intProductId = request.querystring("ProductId")
%>

--
Cheers,
Jon
Microsoft MVP

Linda D said:
I also need to hyperlink to an .asp with parameters based on the selection.

Steve Easton said:
This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

I have a drop down box that is populated using the database results wizard
(into an Access database). How can I use the selection to jump to another
page? There doesn't seem anywhere I can hyperlink although if I bring the
results back as a list this can be achieved.
 
J

Jon Spivey

Hi,
No - I put <form method="get"> so to retrieve the value of productid would
be request.querystring("ProductId"). Of course one could equally well do
<form method="post"> and get the value with request.form("ProductId").


--
Cheers,
Jon
Microsoft MVP

Thomas A. Rowe said:
I think Jon meant to write

intProductId = request.form("ProductId")

instead of

intProductId = request.querystring("ProductId")

since this is a form.


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

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


Jon Spivey said:
Hi Linda,
To add parameters you'd use a form - something along these lines
<form method="get" action="page.asp">
<select name="ProductId">
<option value="1">Widgets</option>
<option value="2">Grommets</option>
etc....
</select>
</form>
Then you can retrieve the paramater with
<%
intProductId = request.querystring("ProductId")
%>

--
Cheers,
Jon
Microsoft MVP

Linda D said:
I also need to hyperlink to an .asp with parameters based on the
selection.

:

This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

I have a drop down box that is populated using the database results
wizard
(into an Access database). How can I use the selection to jump to
another
page? There doesn't seem anywhere I can hyperlink although if I
bring the
results back as a list this can be achieved.
 
T

Thomas A. Rowe

Ok, interesting to know. I never use Get, so wasn't aware that the method is transmitted as a
querystring.

So would the URL appear as:

page.asp?ProductId=selectedvalue

when clicking the form submit button?


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

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


Jon Spivey said:
Hi,
No - I put <form method="get"> so to retrieve the value of productid would be
request.querystring("ProductId"). Of course one could equally well do <form method="post"> and get
the value with request.form("ProductId").


--
Cheers,
Jon
Microsoft MVP

Thomas A. Rowe said:
I think Jon meant to write

intProductId = request.form("ProductId")

instead of

intProductId = request.querystring("ProductId")

since this is a form.


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

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


Jon Spivey said:
Hi Linda,
To add parameters you'd use a form - something along these lines
<form method="get" action="page.asp">
<select name="ProductId">
<option value="1">Widgets</option>
<option value="2">Grommets</option>
etc....
</select>
</form>
Then you can retrieve the paramater with
<%
intProductId = request.querystring("ProductId")
%>

--
Cheers,
Jon
Microsoft MVP

I also need to hyperlink to an .asp with parameters based on the selection.

:

This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

I have a drop down box that is populated using the database results wizard
(into an Access database). How can I use the selection to jump to another
page? There doesn't seem anywhere I can hyperlink although if I bring the
results back as a list this can be achieved.
 
J

Jon Spivey

Yes - look at for example when you do a search on Google, the search query
is sent in the querystring with method=get. I tend to use get for forms that
search data, eg SQL Select queries, so that the results page exists in the
users history and can be bookmarked etc and method=post for anything that
changes data, eg SQL delete, update, insert queries.

--
Cheers,
Jon
Microsoft MVP

Thomas A. Rowe said:
Ok, interesting to know. I never use Get, so wasn't aware that the method
is transmitted as a querystring.

So would the URL appear as:

page.asp?ProductId=selectedvalue

when clicking the form submit button?


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

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


Jon Spivey said:
Hi,
No - I put <form method="get"> so to retrieve the value of productid
would be request.querystring("ProductId"). Of course one could equally
well do <form method="post"> and get the value with
request.form("ProductId").


--
Cheers,
Jon
Microsoft MVP

Thomas A. Rowe said:
I think Jon meant to write

intProductId = request.form("ProductId")

instead of

intProductId = request.querystring("ProductId")

since this is a form.


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

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Hi Linda,
To add parameters you'd use a form - something along these lines
<form method="get" action="page.asp">
<select name="ProductId">
<option value="1">Widgets</option>
<option value="2">Grommets</option>
etc....
</select>
</form>
Then you can retrieve the paramater with
<%
intProductId = request.querystring("ProductId")
%>

--
Cheers,
Jon
Microsoft MVP

I also need to hyperlink to an .asp with parameters based on the
selection.

:

This should do it if you can populate value

<form>
<select id="setit">
<option selected>Select a page</option>
<option value="page1.htm">Page 1</option>
<option value="page2.htm">Page 2</option>
<option value="page3.htm">Page 3</option></select>
<input type="button" value="Go"
onclick="javascript:window.open(setit.options[setit.selectedIndex].value)">
</form>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer

I have a drop down box that is populated using the database results
wizard
(into an Access database). How can I use the selection to jump to
another
page? There doesn't seem anywhere I can hyperlink although if I
bring the
results back as a list this can be achieved.
 
Top