Welcome to WebmasterWorld Guest from 54.221.119.45

Forum Moderators: incrediBILL

Message Too Old, No Replies

option value in firefox

cannot get firefox to do what IE does

     

shannie2007

2:55 am on Feb 27, 2008 (gmt 0)

5+ Year Member



I have an option box on my site and I need to direct the product that I pick to go to that product on the next page and works fine in IE but not in firefox
this is the option code
<table align="center" border="0" cellspacing="0" cellpadding="0">
<tr>

<td align="center">

<select name="MainMenu" onChange="MM_jumpMenu('parent',this,0)">
<option selected>Please Choose from here</option>
<option value="sparkling_hearts.html#1">Necklace,Earrings &amp; Bracelet Set - $40.00</option>
<option value="sparkling_hearts.html#2">Necklace &amp; Bracelet - $35.00</option>
<option value="sparkling_hearts.html#3">Necklace &amp; Earrings - $30.00</option>
<option value="sparkling_hearts.html#4">Bracelet &amp; Earrings - $20.00</option>
<option value="sparkling_hearts.html#5">Necklace - $25.00</option>
<option value="sparkling_hearts.html#6">Bracelet - $15.00</option>
<option value="sparkling_hearts.html#7">Earrings 1 - $10.00</option>
<option value="sparkling_hearts.html#8">Earrings 2 - $10.00</option>
<option value="sparkling_hearts.html#9">Earrings 3 - $10.00</option>

</select>

</td></TR></TABLE>

when I click on any of these options it just goes to the first product
<snip>

also another problem I have is opening those options in a new page as I have tried to put target_blank in the link and it does not work
thank you will appreciate any help

[edited by: BlobFisk at 9:11 am (utc) on Feb. 27, 2008]
[edit reason] Removed URL [/edit]

phranque

12:05 pm on Feb 27, 2008 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], shannie2007!

not sure about the url anchor.
try url encoding the pound/hash character (#) by replacing with its hex equivalent (%23).

for the target, you could change the MM_jumpMenu to make it conditional on targ to do something like:
window.open(selObj.options[selObj.selectedIndex].value, targ, "resizable=yes,scrollbars=yes,status=no");

Achernar

1:06 pm on Feb 27, 2008 (gmt 0)

5+ Year Member



Please show the code of MM_jumpMenu()

shannie2007

2:17 pm on Feb 27, 2008 (gmt 0)

5+ Year Member



sorry forgot the jump menu
<script TYPE="text/javascript" LANGUAGE="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

Achernar

6:29 pm on Feb 27, 2008 (gmt 0)

5+ Year Member



function MM_jumpMenu(targ,selObj,restore){ //v3.0
if (targ=='blank') {
window.open(selObj.options[selObj.selectedIndex].value)
return
}

eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

You don't want to target "parent", since it will clear that frame, including its childrens frames and the one your page is in.

"blank" will open a new window

Possible values for targ:
* _blank: blank
* _parent: parent
* _self: self
* _top: top
* FrameName: parent.FrameName or top.FrameName (depending on the hierachy of framesets)

I've tested and the target page always scrolls to the correct position depending on the #xyz. (verify that your page actually contains the correct anchors)

phranque

12:39 am on Feb 28, 2008 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



just say "no" to frames...

shannie2007

10:52 pm on Mar 1, 2008 (gmt 0)

5+ Year Member



thanks guys for those answers I am trying to do both going to a new window and using the jump menu but they don't work together.
I have found another one if anyone can use it
<select onChange="window.open(this.options[this.selectedIndex].value)" name="s1?">
<option selected>choose from here</option>
<option value="sparkling_hearts.html#1">Necklace,Earrings &amp; Bracelet Set - $40.00</option>
<option value="sparkling_hearts.html#2">Necklace &amp; Bracelet - $35.00</option>
<option value="sparkling_hearts.html#3">Necklace &amp; Earrings - $30.00</option>
<option value="sparkling_hearts.html#4">Bracelet &amp; Earrings - $20.00</option>
<option value="sparkling_hearts.html#5">Necklace - $25.00</option>
<option value="sparkling_hearts.html#6">Bracelet - $15.00</option>
<option value="sparkling_hearts.html#7">Earrings 1 - $10.00</option>
<option value="sparkling_hearts.html#8">Earrings 2 - $10.00</option>
<option value="sparkling_hearts.html#9">Earrings 3 - $10.00</option>
</select>
this opens a new window in IE and Firefox but the jump menu doesn't work with this.
so if you can come up with an answer it would be much appreciated
thanks again for you help
 

Featured Threads

Hot Threads This Week

Hot Threads This Month