Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2004, 04:23 PM   PM User | #1
oh_no!!!!!!!
New to the CF scene

 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh_no!!!!!!! is an unknown quantity at this point
triple menu in new window...

hey java community,

thank you for publishing the great triple menu scipt. I really like it! is there any possibiliy for a java beginner to modify it that the final links open in new windows??

thanx for your help
oh_no!!!!!!! is offline   Reply With Quote
Old 06-24-2004, 04:51 PM   PM User | #2
Roy Sinclair
Senior Coder

 
Join Date: Jun 2002
Location: Wichita
Posts: 3,880
Thanks: 0
Thanked 0 Times in 0 Posts
Roy Sinclair will become famous soon enough
What menu? I don't see a link to anything and you didn't post any code. I suppose I could search for it but as the producer of the question I think it behooves you to provide the necessary information.

FWIW, I'm certain that what you want it to do is quite possible.
__________________
Check out the Forum Search. It's the short path to getting great results from this forum.
Roy Sinclair is offline   Reply With Quote
Old 06-25-2004, 05:06 AM   PM User | #3
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
And I assume you mean Javascript not Java.
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-25-2004, 07:47 AM   PM User | #4
oh_no!!!!!!!
New to the CF scene

 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh_no!!!!!!! is an unknown quantity at this point
yes, of course java script...

here s the link:::::


http://www.wsabstract.com/script/scr...plecombo.shtml
oh_no!!!!!!! is offline   Reply With Quote
Old 06-25-2004, 07:51 AM   PM User | #5
oh_no!!!!!!!
New to the CF scene

 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh_no!!!!!!! is an unknown quantity at this point
sorry for being so clamsy, but it was my first day ....



and the script::::::

<FORM name="isc">
<table border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td nowrap height="11"> &nbsp;

<select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
<option selected>---Select1-------------</option>
<option>Webmaster Sites</option>
<option>News Sites</option>
</select>

<select name="stage2" size="1" onChange="redirect1(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select2--------------</option>
<option value=" " selected>---Select2--------------</option>
</select>

<select name="stage3" size="1" onChange="redirect2(this.options.selectedIndex)">
<option value=" " selected> </option>
<option value=" " selected>---Select3----------------</option>
<option value=" " selected>---Select3----------------</option>
</select>

<script>
<!--

/*
Triple Combo Script Credit
By Hamid Cheheltani/ JavaScript Kit (http://www.javascriptkit.com)
Visit http://javascriptkit.com for this and over 400+ other scripts
*/

var groups=document.isc.example.options.length
var group=new Array(groups)
for (i=0; i<groups; i++)
group[i]=new Array()

group[0][0]=new Option("---Select2---"," ");

group[1][0]=new Option("Now Select This One"," ");
group[1][1]=new Option("JavaScript","47");
group[1][2]=new Option("DHTML","46");
group[1][3]=new Option("CGI","45");

group[2][0]=new Option("Now Select This One"," ");
group[2][1]=new Option("General News","115");
group[2][2]=new Option("Technology News","116");

var temp=document.isc.stage2


function redirect(x){
for (m=temp.options.length-1;m>0;m--)
temp.options[m]=null
for (i=0;i<group[x].length;i++){
temp.options[i]=new Option(group[x][i].text,group[x][i].value)
}
temp.options[0].selected=true
redirect1(0)
}



var secondGroups=document.isc.stage2.options.length
var secondGroup=new Array(groups)
for (i=0; i<groups; i++) {
secondGroup[i]=new Array(group[i].length)
for (j=0; j<group[i].length; j++) {
secondGroup[i][j]=new Array() }}

secondGroup[0][0][0]=new Option("---Select 3---"," ");
secondGroup[1][0][0]=new Option("---Select 3---"," ");
secondGroup[1][1][0]=new Option("Now Select This One"," ");
secondGroup[1][1][1]=new Option("JavaScript Kit","http://javascriptkit.com");
secondGroup[1][1][2]=new Option("JavaScript for the non programmer","http://webteacher.com/javascript/");
secondGroup[1][1][3]=new Option("Java-Scripts.net","http://java-scripts.net");

secondGroup[1][2][0]=new Option("Now Select This One"," ");
secondGroup[1][2][1]=new Option("Dynamic Drive","http://www.dynamicdrive.com");
secondGroup[1][2][2]=new Option("Beginner\'s Guide to DHTML","http://www.geocities.com/ResearchTriangle/Facility/4490/");
secondGroup[1][2][3]=new Option("Web Coder","http://webcoder.com/");

secondGroup[1][3][0]=new Option("Now Select This One"," ");
secondGroup[1][3][1]=new Option("CGI Resources","http://www.cgi-resources.com");
secondGroup[1][3][2]=new Option("Ada\'s Intro to CGI","http://adashimar.hypermart.net/");

secondGroup[2][0][0]=new Option("---Select 3---"," ");
secondGroup[2][1][0]=new Option("Now Select This One"," ");
secondGroup[2][1][1]=new Option("CNN","http://www.cnn.com");
secondGroup[2][1][2]=new Option("MSNBC","http://www.msnbc.com");
secondGroup[2][1][3]=new Option("ABC News","http://www.abcnews.com");

secondGroup[2][2][0]=new Option("Now Select A Page"," ");
secondGroup[2][2][1]=new Option("News.com","http://www.news.com");
secondGroup[2][2][2]=new Option("Wired","http://www.wired.com");

var temp1=document.isc.stage3
function redirect1(y){
for (m=temp1.options.length-1;m>0;m--)
temp1.options[m]=null
for (i=0;i<secondGroup[document.isc.example.options.selectedIndex][y].length;i++){
temp1.options[i]=new Option(secondGroup[document.isc.example.options.selectedIndex][y][i].text,secondGroup[document.isc.example.options.selectedIndex][y][i].value)
}
temp1.options[0].selected=true
}

function redirect2(z){
window.location=temp1[z].value
}

//-->
</script>

</td>
</tr>
</table>
</FORM>

<p><font face="arial" size="-2">This free script provided by</font><br>
<font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>
oh_no!!!!!!! is offline   Reply With Quote
Old 06-25-2004, 08:18 AM   PM User | #6
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Change this:

function redirect2(z){
window.location=temp1[z].value
}

to:

function redirect2(z){
window.open(temp1[z].value, "_blank");
}

That will open the item in a new window always even after the new window is already opened.

If you only want one new window, change it to:

function redirect2(z){
var w = window.open(temp1[z].value, "mywin");
w.focus();
}
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-25-2004, 04:53 PM   PM User | #7
oh_no!!!!!!!
New to the CF scene

 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh_no!!!!!!! is an unknown quantity at this point
thanx for your fast answer...

it really works fine.
would it be possible to set window parameters like *width, height, scrollbar...* in this content??

greets
oh_no!!!!!!! is offline   Reply With Quote
Old 06-25-2004, 05:00 PM   PM User | #8
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
Yes....

Code:
window.open(temp1[z].value, "_blank", "height=400,width=500, scrollbars=no");
.....Willy
Willy Duitt is offline   Reply With Quote
Old 06-25-2004, 07:30 PM   PM User | #9
orlando2002
New to the CF scene

 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
orlando2002 is an unknown quantity at this point
Trying to create this type of triggering cascading menus

Hi,

I'm trying to create this type triggering cascading menus in a student project using the ArcIMS map software. You can see what I've able to manage at http://mithra.uwaterloo.ca/website/s.../mapviewer.htm. Click on the "Search tool" and you'll see two drop down boxes. Below is the code autogenerated by the software. I commented out a change I made. Please notice that in line 48 there's a <form action="" name="theStoreQueryForm"...> which I think is the "FORM" (?). Also notice that the "select name=theStyle" creates the first drop down box. But the actual name is stored/defined in a separate .XLM file (map.axl).

I guess my question is how to modify this code in order to (1) the first box will allow you to select a map layer; (2) the second box will list the name of the query set up for that selected layer; (3) the third box will list the options/criteria set up for the chosen query. I'll appreciate your help.

Gabriel

//The code//
<script language="javascript">
var t_sq;
var t2_sq = "";
if (opener) {
t_sq = opener.parent.MapFrame;
t2_sq = "opener.parent.MapFrame";
} else {
t_sq = parent.MapFrame;
t2_sq = "parent.MapFrame";
}

function setStyle() {
var f = document.forms[0];
var theCount = t_sq.storedQueryIndex;
var okValue = 0;
if (t_sq.storedQueryVarCount[theCount]==1) {
var theValue = f.theStyle.value;
if (theValue!="") okValue = 1;
} else {
var theValue = f.theStyle[0].value;
if (f.theStyle[0].value!="") okValue = 1;
for (var i=1;i<t_sq.storedQueryVarCount[theCount];i++) {
theValue = theValue + "|" + f.theStyle[i].value;
if (f.theStyle[i].value!="") okValue += 1;
}
}
if (okValue==t_sq.storedQueryVarCount[theCount]) {
t_sq.sendStoredQuery(theCount,theValue);
} else {
alert("Please enter appropriate value");
}
}
function selectQuery() {
var f = document.forms[0];
var theIndex = f.theQuery.selectedIndex;
t_sq.writeStoredQueryForm(theIndex);
}
document.writeln('</head>');

document.writeln('<body bgcolor="Gray" text="Black" topmargin=0 leftmargin=0 rightmargin=0 onload="window.focus()">');
document.writeln('<div align="center">');
document.writeln('<font face="Arial" size="-2"><b>');
document.writeln('<form action="" name="theStoreQueryForm" onsubmit="setStyle(); return false;">');
document.writeln('<table cellspacing="2" nowrap bgcolor="' + t_sq.textFrameFormColor + '" width=100%>');
document.writeln('<tr><th colspan="3" align="CENTER">');
document.writeln('<font face="Arial" size="-1"><b>' + t_sq.msgList[78] + '</b><br></font>');
document.writeln('<font face="Arial" size="-2"><b>' + t_sq.msgList[79] + '</b></font>');
document.writeln('</th></tr>');
document.writeln('<tr>');
document.writeln('<td align="Left">');
document.writeln('<font face="Arial" size="-1">' + t_sq.LayerName[t_sq.ActiveLayerIndex]);
document.writeln('<select name="theQuery" onchange="selectQuery()">')
for (var i=0;i<t_sq.storedQueryCount;i++) {
document.write(' <option value=' + i);
if (i==t_sq.storedQueryIndex) document.write(' selected');
document.writeln('>' + t_sq.storedQueryName[i]);

}
document.writeln('</select>');
document.writeln('</font></td>');
document.writeln('<td align="RIGHT"><font face="Arial" size="-1">');
for (var i=0;i<t_sq.storedQueryVarCount[t_sq.storedQueryIndex];i++) {
document.write(t_sq.buttonList[2]);
if (t_sq.storedQueryVarCount[t_sq.storedQueryIndex]>1) document.write(' ' + (i+1));

document.writeln(':');

//was:
//document.writeln('<input type=text name="theStyle" value=""><br>');

//changed to create the 2 drop down boxes
document.writeln('<select name="theStyle">');
document.writeln('<option value="=-1">Above Water Table</option>');
document.writeln('<option value=">=0">Below Water Table</option>');
document.writeln('</select>');


}
document.writeln('</font>');
document.writeln('</td>');
document.writeln('<td align="CENTER">');
document.writeln('<input type="Button" name="setDU" value="' + t_sq.buttonList[6] + '" onclick="setStyle()"> <br>');

document.writeln('</td></tr></table></form>');
document.writeln('</b></font></div>');
document.writeln('</body>');
</script>
orlando2002 is offline   Reply With Quote
Old 10-11-2004, 01:03 PM   PM User | #10
oh_no!!!!!!!
New to the CF scene

 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh_no!!!!!!! is an unknown quantity at this point
hi guys,

would it be also possible to add a forth point to this script?

thanx for all of your replies
greets
oh_no!!!!!!! is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:07 AM.


Advertisement
Log in to turn off these ads.