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] Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/ 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) Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1048953 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] Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1048958 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? Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1048959 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 Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1049214 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> Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1049252 Share on other sites More sharing options...
melindaSA Posted April 28, 2010 Author Share Posted April 28, 2010 Anyone can help on this?? Please! Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1050125 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. Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1050132 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. Link to comment https://forums.phpfreaks.com/topic/199841-need-help-working-in-ie-but-not-firefox/#findComment-1050140 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.