mjcoco Posted May 11, 2008 Share Posted May 11, 2008 I have a tag in the page where the drop down lists are for the .js file <script src="selected.js" type="text/javascript"></script> and in the dropdown i have onchange="GetSecti()"> However in the GetSecti i had GetSecti(this.value) But i was getting errors saying Error: Object Expected If i took them out i recieved the same error. My .js file is as follows // JavaScript Document var xmlHttpfunction GetSecti() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="getselected.php" url=url+"?q="+str url=url+"&sid="+Math.random() xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) }function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("txtHint").innerHTML=xmlHttp.responseText } }function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } which of course then calls the get getselected.php file. I had an alert in there which of course was not getting called since it seems as if the .js file is not being called. Any help on this at all? Thanks Michael Quote Link to comment Share on other sites More sharing options...
Btown2 Posted May 11, 2008 Share Posted May 11, 2008 Not to be a pain, but this is not a javascript board, it is a PHP board. Quote Link to comment Share on other sites More sharing options...
mjcoco Posted May 11, 2008 Author Share Posted May 11, 2008 Not to be a pain, but this is not a javascript board, it is a PHP board. Right well my problem is within my php page itself... I guess I should have mentioned that before... <form action="insertfunc.php" method="post"> <table width="446" height="110" border="0" align="left" cellpadding="20" cellspacing="20"> <tr><td width="172" height="32">TAG:</td> <td width="262"><select name="Un" size="1" id="Un" onchange="GetSecti(str)"> <?php displayUn();?> </select> The php displayUn() calls a php page that inserts the options from a MySQL database and values as the same thing and inserts it into a listbox. In this one i added back the GetSecti(str) to test a few things. Or maybe this still needs to be moved? ??? Quote Link to comment Share on other sites More sharing options...
mjcoco Posted May 11, 2008 Author Share Posted May 11, 2008 GetSecti(str) should not be there it should be GetSecti(this.value), but still am recieveing the same error. 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.