473,799 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select menu and display in the frame

Dear Everybody,

I have a double menu select javascript, could anyone know
how to change it, so that the result will display in a frame
name called "content", please?

Here is the script.
<html><body>
<script>
<!--
v=false;
//-->
</script>
<script>
<!--
if (typeof(Option) +"" != "undefined" ) v=true;
//-->
</script>
<script>
<!-- Begin
if(v){a=new Array();aln=0;}
function getFormNum (formName) {
formNum =-1;
for (i=0;i<document .forms.length;i ++){
tempForm = document.forms[i];
if (formName == tempForm) {
formNum = i;
correctForm = tempForm;
break;
}
}
return formNum;
}
function jmp(formName,el ementNum) {
getFormNum(form Name);
if (formNum>=0) {
with (document.forms[formNum].elements[elementNum]) {
i=selectedIndex ;
if (i>=0) location=option s[i].value;
}
}
}
function O(txt,url) {
a[k]=new Option(txt,url) ;k++;
}
function relate(formName ,elementNum,j) {
if(v) {
k=1;
if(j==0) { // default category item
a=new Array();
O("Select day","");
}

if(j==1) { // 1st category items
a=new Array();
O("Select day","");
O("Dec 25","2003/1225.html");
}

if(j==2) { // 2nd category items
a=new Array();
O("Select day","");
O("March 6","2004/0306.html");
}

aln2=a.length;
getFormNum(form Name);
if (formNum>=0) {
formNum = formNum + 1;
with (document.forms[formNum].elements[elementNum]) {
for (var i=options.lengt h-1;i>0;i--) options[i]=null;
for (var i=1;i<aln2;i++) options[i-1]=a[i];
options[0].selected=true;
}
}
} else {
jmp(formName,el ementNum);
}
}
// End -->
</script>
<center>
<table><tr>
<td align=center valign=bottom>
<form name=f1 method=post action="" onSubmit="retur n false;">
<select name=m1 onChange="relat e(this.form,0,t his.selectedInd ex);
document.f2.m2. focus();">
<option value="/" class=select>Se lect Year
<option value="/" class=year>2003
<option value="/" class=year>2004
</select></form></td>
<td align=center valign=bottom>
<form name=f2 method=post action="" onsubmit="retur n false;">
<select name="m2" onchange="jmp(t his.form,0)">
<option value="/" class=selectday >Select day
<option value="/">
</select></form></td>
</tr></table>
</body></html>
--
thank you very much for your help.
Jul 23 '05 #1
1 1979
quick solution...
i would suggest tho' that you think of a neater way to do this.
Don't get me wrong, not saying its bad or wrong, just from what i see there
are shorter and neater ways to do it :0)

Good luck

Change this funcion to create the url and make it the form's ACTION
then submit the form
function jmp(formName,el ementNum) {
getFormNum(form Name);
if (formNum>=0) {
with (document.forms[formNum].elements[elementNum]) {
i=selectedIndex ;
if (i>=0) frmAction=optio ns[i].value;
document.forms[formNum].action = frmAction;
document.forms[formNum].submit();
}
}
}

give the form the target you want, so when it is submitted above, it'll
sumit to that frame

<form name=f2 method=post TARGET="FRAME_N AME" action="" onsubmit="retur n
false;">
<select name="m2" onchange="jmp(t his.form,0)">
<option value="/" class=selectday >Select day
<option value="/">
</select></form>
cheers
"John Fung" <js*****@netvig ator.com> wrote in message
news:dc******** *************** **@posting.goog le.com...
Dear Everybody,

I have a double menu select javascript, could anyone know
how to change it, so that the result will display in a frame
name called "content", please?

Here is the script.
<html><body>
<script>
<!--
v=false;
//-->
</script>
<script>
<!--
if (typeof(Option) +"" != "undefined" ) v=true;
//-->
</script>
<script>
<!-- Begin
if(v){a=new Array();aln=0;}
function getFormNum (formName) {
formNum =-1;
for (i=0;i<document .forms.length;i ++){
tempForm = document.forms[i];
if (formName == tempForm) {
formNum = i;
correctForm = tempForm;
break;
}
}
return formNum;
}
function jmp(formName,el ementNum) {
getFormNum(form Name);
if (formNum>=0) {
with (document.forms[formNum].elements[elementNum]) {
i=selectedIndex ;
if (i>=0) location=option s[i].value;
}
}
}
function O(txt,url) {
a[k]=new Option(txt,url) ;k++;
}
function relate(formName ,elementNum,j) {
if(v) {
k=1;
if(j==0) { // default category item
a=new Array();
O("Select day","");
}

if(j==1) { // 1st category items
a=new Array();
O("Select day","");
O("Dec 25","2003/1225.html");
}

if(j==2) { // 2nd category items
a=new Array();
O("Select day","");
O("March 6","2004/0306.html");
}

aln2=a.length;
getFormNum(form Name);
if (formNum>=0) {
formNum = formNum + 1;
with (document.forms[formNum].elements[elementNum]) {
for (var i=options.lengt h-1;i>0;i--) options[i]=null;
for (var i=1;i<aln2;i++) options[i-1]=a[i];
options[0].selected=true;
}
}
} else {
jmp(formName,el ementNum);
}
}
// End -->
</script>
<center>
<table><tr>
<td align=center valign=bottom>
<form name=f1 method=post action="" onSubmit="retur n false;">
<select name=m1 onChange="relat e(this.form,0,t his.selectedInd ex);
document.f2.m2. focus();">
<option value="/" class=select>Se lect Year
<option value="/" class=year>2003
<option value="/" class=year>2004
</select></form></td>
<td align=center valign=bottom>
<form name=f2 method=post action="" onsubmit="retur n false;">
<select name="m2" onchange="jmp(t his.form,0)">
<option value="/" class=selectday >Select day
<option value="/">
</select></form></td>
</tr></table>
</body></html>
--
thank you very much for your help.

Jul 23 '05 #2

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

Similar topics

2
6441
by: Joachim Bauer | last post by:
I'm using the code below to display a menu that opens when the mouse goes over the main menu item (try it in your browser to understand the behaviour). It uses "position:absolute" and a switch between "display='none'" and "display=''". However the problem is that - in Internet Explorer 6 the dropdown (<select>...) always hides the menu
2
1624
by: jascraig | last post by:
Here's my dilemma. I'm working with a frameset with 3 frames (header,content,control). My control frame contains a select list with buttons for next and previous. When the next button is pushed the select list moves to the next option and the content frame changes to the next URL, and a page number is updated on the header. The code I have now works great on NS 7 and FF1. When I test it in IE, the select box updates then immediately...
2
2585
by: hemanth.singamsetty | last post by:
Hello there, I've a drop down menu (created using CSS & Javascript -- see code below). My problem is, whenever I click a link on the menu the new page replaces the current page (and the menu disappears). Is there a way, I can keep the menu always on top. ( A good example of what I'm looking for is similar to the menu bar in http://www.milonic.com/ ).
3
1694
by: Ohad Young | last post by:
Hi, I have a frameset page that contains two frames: 1. the first frame, an aspx page, contains a menu for navigating in the website. 2. the second frame contains content, pdf, html or other aspx files The problem is that the menu activates a server-side methods when the user clicks on one of the menu items. However, from the server side I cannot control in which frame the content will appears, it will always be in the menu frame...
1
1208
by: server side menu problem2 | last post by:
hi, in my site there r 2 frames: 1.menu frame 2.application display the menu is based on <A HREF=...> because I need to direct the pages to the application display frame.now I need to cuach a session before I redirect the page and <AHREF=...> is not build for that.I need un aspx control that has the property "target" so Icould redirect the page to the write fame. So, how can I control from a server side function the frame to display the...
2
1780
by: fuchsteiner | last post by:
I can't find any support for frames in the asp:menu control. Not the Target frame, but displaying sub-menus across a frame boundary. There are lots of 3rd party Menu tools that do this. I have a small horizontal frame that contains the first level of menus and I want second level of menus to display in another frame. I am not finding any references on how to do this on the web. Help!
1
1608
nomad
by: nomad | last post by:
I need help with JcomboBox When and User select the Exit in the File box it will the //inner class class exitListener implements ActionListener { ... } which it open a window asking them if they want to close the program. I have a statement filemenu.setMnemonic(KeyEvent.VK_X);
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.