Jump to content

Jump menu in IE not working


timmah1

Recommended Posts

I have this jump menu that works great in firefox, but it don't do anything in IE.

I have it so that when you click on a category, the sub-categories show below the menu in a div tag.

Like I said, it works in Firefox, but not IE.

 

Can anybody tell me why? Or maybe have a better solution?

 

Here is the code

      <select name="mainID" id="mainID" onchange="MM_jumpMenu('content',this,0)">
      <option></option>
        <?php
$query = "SELECT * FROM subCat1 WHERE main = '5' ORDER BY name";
$portfolio = mysql_query($query);
$numrows = mysql_num_rows($portfolio);
while ($a = mysql_fetch_array($portfolio))	{
$id = $a['id'];
$name = $a['name'];
?>
    <option value="<?=$id;?>" onClick='check_content("sub.php?id=<?=$id;?>&page=sublinks")'><?=$name;?></option>
    <?php } ?>
      </select>

<div id='content'></div>

 

Thanks in advance

Link to comment
Share on other sites

The problem might be caused by hopping in and out of PHP.  Why not deal with the 'while' statement first of all, reading stuff into an array, then tackle the next bit separately

eg :

 

$count = 0;

while ($a = mysql_fetch_array($portfolio)) {

$id[$count]      = $a['id'];

$name[$count] = $a['name'];

            $count++;

            }

 

Now you've got a clean "while" loop and the results in an array.  Now push on with the "button" part of the coding.

 

Dunno if that helps, but maybe worth a try.  Good luck !

Link to comment
Share on other sites

You can hop in and out of php just fine.  The php parser looks at the stuff between the closing tag and next opening tag as a string it doesn't have to parse.  The whole script is executed server-side then results sent to client. 

 

This is obviously a clientside issue.  Why are you posting in the php forum? Moving this to the javascript forum, and I suggest you post your javascript code and possibly your css if you have any because nobody is going to be able to tell you what's wrong with out it.

Link to comment
Share on other sites

I"m sorry, I didn't mean to post it in the php forum, simple mistake.

 

My javascript is here

<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.