Welcome to WebmasterWorld Guest from 54.147.63.124

Forum Moderators: incrediBILL

Message Too Old, No Replies

option value in firefox

cannot get firefox to do what IE does

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

New User

5+ Year Member

joined:Feb 27, 2008
posts: 3
votes: 0


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]

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

Administrator

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

joined:Aug 10, 2004
posts:10544
votes: 8


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");

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

Full Member

5+ Year Member

joined:Dec 3, 2006
posts:257
votes: 0


Please show the code of MM_jumpMenu()
2:17 pm on Feb 27, 2008 (gmt 0)

New User

5+ Year Member

joined:Feb 27, 2008
posts: 3
votes: 0


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>
6:29 pm on Feb 27, 2008 (gmt 0)

Full Member

5+ Year Member

joined:Dec 3, 2006
posts:257
votes: 0


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)

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

Administrator

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

joined:Aug 10, 2004
posts:10544
votes: 8


just say "no" to frames...
10:52 pm on Mar 1, 2008 (gmt 0)

New User

5+ Year Member

joined:Feb 27, 2008
posts:3
votes: 0


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
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members