Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript not working in IE7 but working in firefox

 
carina caoor
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi my javascript is


function getCode()
{
for(i=0;i<document.areacodeform.areacoderadio.length;i++)
{
if(document.areacodeform.areacoderadio[i].checked)
{
opener.document.createplotform.sacode.value = document.areacodeform.areacoderadio[i].value;
opener.document.createplotform.sacode.focus();
self.close();
}
}
}

var skipcycle = false;


var xmlHttp;
function createXmlHttpRequest()
{


if(window.ActiveXObject)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(err1)
{
xmlHttp=new ActiveXObject("Msml2.XMLHTTP");
}
}

else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
return xmlHttp;
}


function matchAreacode()
{
createXmlHttpRequest();
var u1=document.areacodeform.isacode.value;
//var u1=str;
xmlHttp.open("GET","http://localhost:8080/Matchcode?code="+u1,true);
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);

}

function handleStateChange()
{


if(xmlHttp.readyState==4)
{
var l = "<table>";
if(xmlHttp.status==200)
{

var alength=xmlHttp.responseXML.getElementsByTagName("addcode");

for(i=0;i<alength.length;i++)
{
var message= new Array(alength.length);
message[i] = xmlHttp.responseXML.getElementsByTagName("addcode")[i].childNodes[0].nodeValue;
l =l+"<tr><td><input type='radio' name='areacoderadio' value='"+message[i]+"'>"+message[i]+"</td></tr>";
//alert("Response Generated\n"+i+" "+message[i]);




}
l=l+"</table>";
document.getElementById('displayareacode').innerHTML=l;

}

else
{
alert("Error loading page"+ xmlHttp.status +
":"+xmlHttp.statusText);
}


}
}



I have a jsp that on click of button calls servlet this servlet presents a child window in which i have a input field onkeyup in this input field fires ajax calls and calls another servlet that fetch data from database and present the data in child window on selecting given data from child window the selected value should pass to the parent jsp file that initiating the whole process.
This is working well and good in firefox but in IE7 its not working in the child window i am unable to select the value and the values are not getting passed to the parent jsp.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64688
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic