• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Adding a target frome to this JAVA script???

hardwarephreak

[H]ard|Gawd
Joined
Jul 13, 2002
Messages
1,283
Here is the code I am using...I need to add the ability to target a specfic frame?

how would I go about doing this with this code:

<script type="text/javascript">
<!--
// original code by Bill Trefzger 12/12/96
// [Get HomeSite at www.macromedia.com]
function go(){
if (document.selecter1.select1.options
[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options
[document.selecter1.select1.selectedIndex].value
}
}
//-->
</script>
<script type="text/javascript">
<!--
document.write('<form name="selecter1">');
document.write('<select name="select1">');
document.write('<option value="none">Select your destination');
document.write('<option value="none">----------------------------');
document.write('<option value="#1">1');
document.write('<option value="#2">2');
document.write('<option value="#3">3');
document.write('<option value="#4">4');
document.write('</select>');
document.write('<input type="button" value="Go" onClick="go()">');
document.write('</form>');
// end hiding contents -->
</script>
 
Originally posted by hardwarephreak
function go(){
if (document.selecter1.select1.options
[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options
[document.selecter1.select1.selectedIndex].value
}
}
//-->
</script>
change the 'location = ...' line to
Code:
    newWindow = open("http://path.to/the/page.html" + document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value);
you need to add the whole url (or maybe relative) of the current page because it looks like you're using anchors

my personal opinion is that it's silly to open a new window of the same page just to go to an anchor. either create a seperate page for each anchor section that gets opened in a new window or trust the user can use the back or home button to get to the top of the page again

also, please use code tags in the future instead of the quote tags when appropriate. it makes it easier to read and maintains proper indentation
 
Would this be a better script to use? I have been trying to settle on a piece of drop down box code.

I already changed the target frame to inline

<script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</script>


<form action="dummy" method="post"><select name="choice" size="1" onChange="jump(this.form)"><option value="">Sweepers</option><option value="">------------------------</option><option value="http://www.cvrallhawaii.com/kleemsweep27.htm">Kleen Sweep 27</option><option value="http://www.cvrallhawaii.com/kleemsweep35.htm">Kleen Sweep 35</option><option value="http://www.cvrallhawaii.com/kleemsweep40.htm">Kleen Sweep 40</option><option value="http://www.cvrallhawaii.com/kleemsweep45.htm">Kleen Sweep 45</option></select></form>
 
Back
Top