melindaSA Posted April 26, 2010 Share Posted April 26, 2010 I am pulling data from a mySQL database into two dropdowns and then submitting the choices from the dropdowns into another table in the database. This works great in IE but will not work in Firefox. The submit to the database of the 2nd dropdown is not working. I have attached my code in a txt file. Any help would be greatly appreciated..... Thank you!!! [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
de.monkeyz Posted April 26, 2010 Share Posted April 26, 2010 Just want to note that your selected code is wrong. In html it is selected="selected" not just selected. Can you post the html output of this please? (In Firefox press Ctrl+U) Quote Link to comment Share on other sites More sharing options...
melindaSA Posted April 26, 2010 Author Share Posted April 26, 2010 Thank you will fix the selected errror... Attached is the output file... [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
de.monkeyz Posted April 26, 2010 Share Posted April 26, 2010 I noticed that the second dropdown is populated from a $_GET variable. Is this variable set? Quote Link to comment Share on other sites More sharing options...
melindaSA Posted April 27, 2010 Author Share Posted April 27, 2010 Sorry still learning php, how do I do this? Thank you so much for looking at this for me, I am going crazy to find out why it will not work Quote Link to comment Share on other sites More sharing options...
melindaSA Posted April 27, 2010 Author Share Posted April 27, 2010 Ths is also not working in IE! It is not working at all, not submitting to the database! If i look at the page source, the 2nd dropdown is shown.... is the following be the problem? HELP!! <script language="javascript"> function chkprofile(){ err=""; if(profilefrm.sfname.value=="") err+="- first name is required.\n"; if(profilefrm.slname.value=="") err+="- last name is required.\n"; if(profilefrm.sschoolid.value=="") err+="- school is required.\n"; if(profilefrm.sgradeid.value=="") err+="- grade is required.\n"; //if(profilefrm.sdob.value=="") // err+="- date of birth is required.\n"; if(err!=""){ err='Following are the errors : \n'+err; alert(err); return false; } return true; } function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getGrade(schoolid) { profilefrm.sgradeid.value=""; var strURL="findGrade.php?schoolid="+schoolid; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('gradediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } </script> Quote Link to comment Share on other sites More sharing options...
melindaSA Posted April 28, 2010 Author Share Posted April 28, 2010 Anyone can help on this?? Please! Quote Link to comment Share on other sites More sharing options...
jdavidbakr Posted April 28, 2010 Share Posted April 28, 2010 You might want to look into a framework to handle your ajax calls (mootools is my favorite but there are others that are probably just as good) - ajaxy stuff can get very complicated when you're dealing with cross-browser compatibility. Quote Link to comment Share on other sites More sharing options...
melindaSA Posted April 28, 2010 Author Share Posted April 28, 2010 Thank you I will take a look at mootools. 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.