timmah1 Posted February 8, 2009 Share Posted February 8, 2009 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 Quote Link to comment Share on other sites More sharing options...
grissom Posted February 8, 2009 Share Posted February 8, 2009 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 ! Quote Link to comment Share on other sites More sharing options...
.josh Posted February 8, 2009 Share Posted February 8, 2009 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. Quote Link to comment Share on other sites More sharing options...
timmah1 Posted February 8, 2009 Author Share Posted February 8, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.