473,242 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

Arrgh, I know this can work.

OK,

I am trying to write a drop-down box that changes the page url onClick. So
far so good, I have the code for that. What I need to know is how do I make
it load it a different frame? I have about 700 existing HTML pages, and do
not want to go in and code a menu on all of them, so I want to make a menu
in a left frame (named left), and have the items load in the main frame
(named main). Below is the code I have thus far. Any help would be
appreiciated.

Thanks in adavnce,

ML

<script language="JavaScript">
function openDir( form ) {
var newIndex = form.menu1.selectedIndex;
if ( newIndex == 0 ) {
alert( "Please select a location!" );
} else {
cururl = form.menu1.options[ newIndex ].value;
window.location.assign( cururl );
}
}
</script>

<form name="menu">
<select name="menu1" size="1"
onChange="openDir( this.form )">
<option>1 - 49</option>
<option value="0001/index.html">0001</option>
<option value="0002/index.html">0002</option>
<option value="0003/index.html">0003</option>
</select>
Jul 23 '05 #1
3 943
On Fri, 7 May 2004 01:49:08 -0700, MLewis wrote:

[cut]
so I want to make a menu
in a left frame (named left), and have the items load in the main frame
(named main). Below is the code I have thus far. Any help would be
appreiciated.


<script type="text/javascript">
function openDir(sel){
var newIndex=sel.selectedIndex;
if (newIndex==0){
alert("Please select a location!");
}else{
top.main.location.href=sel.options[newIndex].value;
}
}
</script>

<form name="menu" action="">
<select name="menu1 size="1" onchange="openDir(this)">
<option selected="true">1 - 49</option>
<option value="0001/index.html">0001</option>
<option value="0002/index.html">0002</option>
<option value="0003/index.html">0003</option>
</select>
</form>

I hope it helps.

--
C'ya,
ZER0 :: coder.gfxer.webDesigner();

Le donne si dividono in 4 categorie: le suore (non la danno a nessuno);
le puttane (la danno a tutti); le stronze (la danno a tutti tranne che
a te); le rompiballe (la danno a te e solo a te).
Jul 23 '05 #2
see the post below this one..

submit your form and give it your target..
instead of doing a navigate or location

:0)

"MLewis" <ml****@mlewis.biz> wrote in message
news:Z3Imc.77708$Jy3.59949@fed1read03...
OK,

I am trying to write a drop-down box that changes the page url onClick. So far so good, I have the code for that. What I need to know is how do I make it load it a different frame? I have about 700 existing HTML pages, and do not want to go in and code a menu on all of them, so I want to make a menu
in a left frame (named left), and have the items load in the main frame
(named main). Below is the code I have thus far. Any help would be
appreiciated.

Thanks in adavnce,

ML

<script language="JavaScript">
function openDir( form ) {
var newIndex = form.menu1.selectedIndex;
if ( newIndex == 0 ) {
alert( "Please select a location!" );
} else {
cururl = form.menu1.options[ newIndex ].value;
window.location.assign( cururl );
}
}
</script>

<form name="menu">
<select name="menu1" size="1"
onChange="openDir( this.form )">
<option>1 - 49</option>
<option value="0001/index.html">0001</option>
<option value="0002/index.html">0002</option>
<option value="0003/index.html">0003</option>
</select>

Jul 23 '05 #3
On Fri, 7 May 2004 15:18:53 +0200, Dominique wrote:
see the post below this one..

submit your form and give it your target..
instead of doing a navigate or location


But in this way you do a POST request. In that case you don't need it. You
haven't data to pass on the next URL; you change only the current location.

In addition, with a POST request, if the user refresh the page, there is a
warning message. Not useful, in that case.

P.S.
Sorry for my english, is not very good.. ^_^"
--
C'ya,
ZER0 :: coder.gfxer.webDesigner();

"When you have eliminated the impossible, whatever remains,
however improbable, must be the truth." (S.H.)
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jacques Koorts | last post by:
Hi I really don't know anymore how to solve this problem. I bought .NET thinking i can debug my way out of it but still no cigar. This very simple piece of code does not work: Now here some...
10
by: Richard A. DeVenezia | last post by:
At line this.timerId = setInterval (function(){this.step()}, 100) I get error dialog Error:Object doesn't support this property or method. If I change it to this.timerId = setInterval...
20
by: Simon Harvey | last post by:
Festive greetings fellow programmers! I've been programming now for about 4, maybe 5 years now. 4 of those years were at university so and I havent had much work experience of making real world...
5
by: Vinay | last post by:
Hi I have a corrupt word file. I am able to open it with the code given below tr Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo( pInfo.UseShellExecute...
72
by: ravi | last post by:
I have a situation where i want to free the memory pointed by a pointer, only if it is not freed already. Is there a way to know whether the memory is freed or not?
5
by: Michael C | last post by:
....on a remote machine? Thanks, Michael C.
7
by: BVM | last post by:
Hi, Friends: Our reception lady wants to know if a staff is in office or not when a call comes in. I think if this staff has logged on to the network, he probably in office. Otherwise he is not in...
0
by: Kueishiong Tu | last post by:
I have a window form application. It requires to retrieve data from a web site. Since the web request is very time consuming, so I create a work thread to do the job. How does the window main form...
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.