Pulldown list with hyperlinks

  • Thread starter Thread starter Ted
  • Start date Start date
T

Ted

Hi
I´m using FP2003 and I want to create a pulldown list where the options
shall link to an InLineFrame on the page and I don´t want to use a
submitbutton.

I have the script for the pulldown menu without button but I cant adress to
the targetframe (target=text) correct. Is there anyone who could help me
with this.

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option selected value=""select>Select ....
<option value="pagewhatever1.htm">Countries
<option value="pagewhatever2.htm" >City
</option>
</select>
</form>

Ted
 
You need to use onchange to launch a function and then have the function write to the Iframe.

onchange="load()"


Name the Iframe "container" : id="container"
and then identify the source or src as the selected value in the dropdown.


<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>

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

This is what I have on the page and it doesn´t work, I appreciate if you
could take a look
Ted


<head>
<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>
</head>

<body>
<form name="form">
<select name="site" size=1 onChange="load()">
<OPTION VALUE=selected"">Alternativ
<OPTION VALUE="info/lar ditt barn sunda kostvanor.htm">Lar ditt barn sunda
kostvanor
<OPTION VALUE="info/kosten_nyfodda_barnet.htm">Kosten till det nyfodda
barnet
</SELECT>
</form>

<iframe name="container" width="500" height="100%" src="frame.htm"
style="background-color: #FFFFCC" border="1" frameborder="1">
</iframe>



Steve Easton said:
You need to use onchange to launch a function and then have the function write to the Iframe.

onchange="load()"


Name the Iframe "container" : id="container"
and then identify the source or src as the selected value in the dropdown.


<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>

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

Hi
I´m using FP2003 and I want to create a pulldown list where the options
shall link to an InLineFrame on the page and I don´t want to use a
submitbutton.

I have the script for the pulldown menu without button but I cant adress to
the targetframe (target=text) correct. Is there anyone who could help me
with this.

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option selected value=""select>Select ....
<option value="pagewhatever1.htm">Countries
<option value="pagewhatever2.htm" >City
</option>
</select>
</form>

Ted
 
Try adding the form name to the script, but change the name of the form so it isn't the same as the
form element.
I changed it to myform

Also replace all spaces in file names with underscores. Spaces break links and also javascript.
You will need to do this to the actual files also.

<script type="javascript">
function load() {
document.all.container.src = (myform.site.options[myform.site.selectedIndex].value);
}
</script>

<form name="myform">
<select name="site" size=1 onChange="load()">
<OPTION VALUE=selected"">Alternativ
<OPTION VALUE="info/lar_ditt_barn_sunda_kostvanor.htm">Lar ditt barn sunda kostvanor
<OPTION VALUE="info/kosten_nyfodda_barnet.htm">Kosten till det nyfodda barnet
</SELECT>
</form>




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

Ted said:
Steve

This is what I have on the page and it doesn´t work, I appreciate if you
could take a look
Ted


<head>
<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>
</head>

<body>
<form name="form">
<select name="site" size=1 onChange="load()">
<OPTION VALUE=selected"">Alternativ
<OPTION VALUE="info/lar ditt barn sunda kostvanor.htm">Lar ditt barn sunda
kostvanor
<OPTION VALUE="info/kosten_nyfodda_barnet.htm">Kosten till det nyfodda
barnet
</SELECT>
</form>

<iframe name="container" width="500" height="100%" src="frame.htm"
style="background-color: #FFFFCC" border="1" frameborder="1">
</iframe>



Steve Easton said:
You need to use onchange to launch a function and then have the function write to the Iframe.

onchange="load()"


Name the Iframe "container" : id="container"
and then identify the source or src as the selected value in the dropdown.


<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>

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

Hi
I´m using FP2003 and I want to create a pulldown list where the options
shall link to an InLineFrame on the page and I don´t want to use a
submitbutton.

I have the script for the pulldown menu without button but I cant adress to
the targetframe (target=text) correct. Is there anyone who could help me
with this.

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option selected value=""select>Select ....
<option value="pagewhatever1.htm">Countries
<option value="pagewhatever2.htm" >City
</option>
</select>
</form>

Ted
 
Thanks for your help Steve I got it working now.
Ted
Steve Easton said:
Try adding the form name to the script, but change the name of the form so it isn't the same as the
form element.
I changed it to myform

Also replace all spaces in file names with underscores. Spaces break links and also javascript.
You will need to do this to the actual files also.

<script type="javascript">
function load() {
document.all.container.src = (myform.site.options[myform.site.selectedIndex].value);
}
</script>

<form name="myform">
<select name="site" size=1 onChange="load()">
<OPTION VALUE=selected"">Alternativ
<OPTION VALUE="info/lar_ditt_barn_sunda_kostvanor.htm">Lar ditt barn sunda kostvanor
<OPTION VALUE="info/kosten_nyfodda_barnet.htm">Kosten till det nyfodda barnet
</SELECT>
</form>




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

Steve

This is what I have on the page and it doesn´t work, I appreciate if you
could take a look
Ted


<head>
<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>
</head>

<body>
<form name="form">
<select name="site" size=1 onChange="load()">
<OPTION VALUE=selected"">Alternativ
<OPTION VALUE="info/lar ditt barn sunda kostvanor.htm">Lar ditt barn sunda
kostvanor
<OPTION VALUE="info/kosten_nyfodda_barnet.htm">Kosten till det nyfodda
barnet
</SELECT>
</form>

<iframe name="container" width="500" height="100%" src="frame.htm"
style="background-color: #FFFFCC" border="1" frameborder="1">
</iframe>



Steve Easton said:
You need to use onchange to launch a function and then have the
function
write to the Iframe.
onchange="load()"


Name the Iframe "container" : id="container"
and then identify the source or src as the selected value in the dropdown.


<script type="javascript">
function load() {
document.all.container.src = (site.options[site.selectedIndex].value);
}
</script>

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

Hi
I´m using FP2003 and I want to create a pulldown list where the options
shall link to an InLineFrame on the page and I don´t want to use a
submitbutton.

I have the script for the pulldown menu without button but I cant
adress
to
the targetframe (target=text) correct. Is there anyone who could help me
with this.

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option selected value=""select>Select ....
<option value="pagewhatever1.htm">Countries
<option value="pagewhatever2.htm" >City
</option>
</select>
</form>

Ted
 

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