• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

JavaScript not working in IE7 but working in firefox

 
Ranch Hand
Posts: 300
Eclipse IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic