drop down selections

  • Thread starter Thread starter DXB
  • Start date Start date
D

DXB

i want 5 catagories in a drop down box, with a "go"
botton next to it. when i specify the value "url" of the
selections, the go button still doesnt do anything. i
want it to jump to that selections page. suggestions ?
 
There are several ways to do that and they need javascript. Here's one that doesn't need a Go
button, it senses what the user has clicked on.

<p align="center"><b>Select a Site or Function: </b><select id="setit" onchange="launchit()">
<option value="">Select one</option>
<option value="javascript:window.open('http://www.altavista.com')">AltaVista</option>
<option value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option value="javascript:window.open('http://www.google.com')">Google</option>
</select>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
Keep in mind though that people who can't use a mouse won't be able to use this.
So modify it and add a Go button.
Remove onchange="launchit()" from the select tag and make the Go button an onclick="launchit()"
event to fire the function.

Here's an example that uses the Go button:

<b>Select a Site or Function: </b><select id="setit">
<option value="">Select one</option>
<option value="javascript:window.open('http://www.altavista.com')">AltaVista</option>
<option value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option value="javascript:window.open('http://www.google.com')">Google</option>
</select><input type="button" value="Go" onclick="launchit()"></input>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>



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

Steve Easton said:
There are several ways to do that and they need javascript. Here's one that doesn't need a Go
button, it senses what the user has clicked on.

<p align="center"><b>Select a Site or Function: </b><select id="setit" onchange="launchit()">
<option value="">Select one</option>
<option value="javascript:window.open('http://www.altavista.com')">AltaVista</option>
<option value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option value="javascript:window.open('http://www.google.com')">Google</option>
</select>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>


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

DXB said:
i want 5 catagories in a drop down box, with a "go"
botton next to it. when i specify the value "url" of the
selections, the go button still doesnt do anything. i
want it to jump to that selections page. suggestions ?
 
It is not necessary to remove it from the select tag. By keeping it there, onchange will work for the majority of people and the rest can use the go button.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.


nntp://msnews.microsoft.com/microsoft.public.frontpage.client/<[email protected]>

Keep in mind though that people who can't use a mouse won't be able to use this.
So modify it and add a Go button.
Remove onchange="launchit()" from the select tag and make the Go button an onclick="launchit()"
event to fire the function.

Here's an example that uses the Go button:

<b>Select a Site or Function: </b><select id="setit">
<option value="">Select one</option>
<option value="javascript:window.open('http://www.altavista.com')">AltaVista</option>
<option value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option value="javascript:window.open('http://www.google.com')">Google</option>
</select><input type="button" value="Go" onclick="launchit()"></input>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>



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

Steve Easton said:
There are several ways to do that and they need javascript. Here's one that doesn't need a Go
button, it senses what the user has clicked on.

<p align="center"><b>Select a Site or Function: </b><select id="setit" onchange="launchit()">
<option value="">Select one</option>
<option value="javascript:window.open('http://www.altavista.com')">AltaVista</option>
<option value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option value="javascript:window.open('http://www.google.com')">Google</option>
</select>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>


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

DXB said:
i want 5 catagories in a drop down box, with a "go"
botton next to it. when i specify the value "url" of the
selections, the go button still doesnt do anything. i
want it to jump to that selections page. suggestions ?



[microsoft.public.frontpage.client]
 
It still won't work for someone using a keyboard. If you leave it in the
select tag, someone using the keyboard (the tab key and the up and down
arrows) to tab through the form will not be able to make a secletion and
then tab to the Go button. Once they start using the down arrow to make a
selection, the first link they "select" gets fired by the script.

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
Connect to the Newsgroups with Outlook Express
http://www.tushar-mehta.com/misc_tutorials/oe_ng/index.html


JPKarlsen said:
It is not necessary to remove it from the select tag. By keeping it
there, onchange will work for the majority of people and the rest can
use the go button.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
nntp://msnews.microsoft.com/microsoft.public.frontpage.client/ said:
Keep in mind though that people who can't use a mouse won't be able
to use this. So modify it and add a Go button.
Remove onchange="launchit()" from the select tag and make the Go
button an onclick="launchit()" event to fire the function.

Here's an example that uses the Go button:

<b>Select a Site or Function: </b><select id="setit">
<option value="">Select one</option>
<option
value="javascript:window.open('http://www.altavista.com')">AltaVista</option

<option
value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option
value="javascript:window.open('http://www.google.com')">Google</option>
</select><input type="button" value="Go"
onclick="launchit()"></input>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>



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

> There are several
ways to do that and they need javascript. Here's one that doesn't
need a Go > button, it senses what the user has clicked on. >
<p align="center"><b>Select a Site or Function: </b><select
id="setit" onchange="launchit()"> > <option value="">Select
one</option> > <option
value="javascript:window.open('http://www.altavista.com')">AltaVista</option
value="javascript:window.open('http://www.yahoo.com')">Yahoo said:
value="javascript:window.open('http://www.google.com')">Google said:
</select> > > <script language="javascript"> > function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>


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

DXB said:
i want 5 catagories in a drop down box, with a "go"
botton next to it. when i specify the value "url" of the
selections, the go button still doesnt do anything. i
want it to jump to that selections page. suggestions ?



[microsoft.public.frontpage.client]
 
You should be able to check for keydown and cancel the action. It may be a little much work though just to have both options.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.


nntp://msnews.microsoft.com/microsoft.public.frontpage.client/<[email protected]>

It still won't work for someone using a keyboard. If you leave it in the
select tag, someone using the keyboard (the tab key and the up and down
arrows) to tab through the form will not be able to make a secletion and
then tab to the Go button. Once they start using the down arrow to make a
selection, the first link they "select" gets fired by the script.

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/
Connect to the Newsgroups with Outlook Express
http://www.tushar-mehta.com/misc_tutorials/oe_ng/index.html


JPKarlsen said:
It is not necessary to remove it from the select tag. By keeping it
there, onchange will work for the majority of people and the rest can
use the go button.


Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
nntp://msnews.microsoft.com/microsoft.public.frontpage.client/ said:
Keep in mind though that people who can't use a mouse won't be able
to use this. So modify it and add a Go button.
Remove onchange="launchit()" from the select tag and make the Go
button an onclick="launchit()" event to fire the function.

Here's an example that uses the Go button:

<b>Select a Site or Function: </b><select id="setit">
<option value="">Select one</option>
<option
value="javascript:window.open('http://www.altavista.com')">AltaVista</option

<option
value="javascript:window.open('http://www.yahoo.com')">Yahoo</option>
<option
value="javascript:window.open('http://www.google.com')">Google</option>
</select><input type="button" value="Go"
onclick="launchit()"></input>

<script language="javascript">
function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>



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

> There are several
ways to do that and they need javascript. Here's one that doesn't
need a Go > button, it senses what the user has clicked on. >
<p align="center"><b>Select a Site or Function: </b><select
id="setit" onchange="launchit()"> > <option value="">Select
one</option> > <option
value="javascript:window.open('http://www.altavista.com')">AltaVista</option
value="javascript:window.open('http://www.yahoo.com')">Yahoo said:
value="javascript:window.open('http://www.google.com')">Google said:
</select> > > <script language="javascript"> > function launchit(){
eval(setit.options[setit.selectedIndex].value);
}
</script>


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

DXB said:
i want 5 catagories in a drop down box, with a "go"
botton next to it. when i specify the value "url" of the
selections, the go button still doesnt do anything. i
want it to jump to that selections page. suggestions ?



[microsoft.public.frontpage.client]


[microsoft.public.frontpage.client]
 
you need a javascript to make the form 'do' anything such as jump to an url.


This script should help - copy and paste into notepad first, then paste into
Frontpage (code view) in the <head> section

<script language="JavaScript">
<!-- Hide from non-java browsers
// JavaScript: pull down menu of links to web pages : author: David Doull (c)
1997
// Please use freely but include this message
function jump(jf){
// iterate through options until selected option is found
for (i=0; jf.jumplist.options.selected ==false; i++){}
// jump to the page specified by the value associated with the
// selected option
window.location.href=jf.jumplist.options.value;
}
//--> </script>


then put this form (replacing the options in the example with your own)

<FORM NAME="FrontPage_Form2" onsubmit="return FrontPage_Form2_Validator(this)"
language="JavaScript">
<font face="Trebuchet MS"><b>
<font face="Trebuchet MS" size="2">Select Parish from List:</font><font
face="Trebuchet MS" style="font-size: 14pt"><!--webbot bot="Validation"
b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1"
name="jumplist" tabindex="6">
<option>-- Select One --</option>
<option>Option 1</option>
<option> Option 2</option>
</select></font></b></font><font face="Trebuchet MS" style="font-size:
14pt">
<INPUT TYPE=button value="go to the page" onClick="jump(this.form)">
</FORM>
 

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