Object Required .js Error In Ie8
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Internet Explorer 8 error, Object Required (JavaScript) up vote 0 down vote favorite I wrote a todo in chrome that works fine. I tested it in IE8 and it didn't work. So I made a new file to write specifically in IE8, and I can't even get a simple function to work properly. I would like help in finding out what i'm doing wrong. Thank you to anyone that can school me on this. HTML
Home
Javascript var inItemText = document.getElementById("inItemText"); function doIt() { var itemText; itemText = inItemText.value; document.getElementById("p1").innerHTML = itemText; form1.reset(); } javascript internet-explorer internet-explorer-8 share|improve this question asked Jan 30 '15 at 0:25 MrEhawk82 2231317 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote accepted Make sure you do the inItemText assignment after the DOM has been loaded. Otherwise, document.getElementById("inItemText") won't find the element, because it doesn't exist yet. Either put it at the end of the , or use window.onload: var inItemText; window.onload = function() { inItemText = document.getElementById("inItemText"); }; share|improve this answer answered Jan 30 '15 at 0:36 Barmar 273k23126213 add a comment| up vote 0 down vote You're getting that error because inItemText isn't defined. Use document.getElementById('inItemText'). share|improve this answer answered Jan 30 '15 at 0:28 Matt Harper 1178 add a comment| up vote 0 down vote I think the issue is in this line: itemText = inItemText.value; You need to declare "inItemText" as a variable. Perhaps replace it with: itemText = document.getElementById("inItemText").value share|improve this answer answered Jan 30 '15 at 0:28 Brennan 1,0131513 1 He has that assignment right before the function definition. –Barmar Jan 30 '15 at 0:33 That did the trick. Thank you. If you have time, can you explain why the code works in chrome, but not IE? And would it be a good practice to just write all my code to workhere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Object required error in IE8 up vote -1 http://stackoverflow.com/questions/28227214/internet-explorer-8-error-object-required-javascript down vote favorite 1 Actually I am working on asp web application which designed by previous employee, I am actually handling that application after him, So, I am facing some sort of problem when I open that application in IE8 the problem is Object required function getAjaxResponseListe(ther,theval) { //Specif Prix Sign IN pIDType=1 //if (document.FormMTI.ON_IDType[1].checked){pIDType=2} if (document.getElementById('IDType_2').checked){pIDType=2} pIDFamille=2 //if (document.FormMTI.ON_IDFamille[1].checked){pIDFamille=3} if (document.getElementById('IDFamille_2').checked){pIDFamille=3} pIDMode=1 //if (document.FormMTI.ON_IDMode[1].checked){pIDMode=2} if (document.getElementById('IDMode_2').checked){pIDMode=2} http://stackoverflow.com/questions/19425410/object-required-error-in-ie8 switch (ther) { case 1: pIDType=theval; break; case 2: pIDFamille=theval; break; case 3: pIDMode=theval; break; } Please ignore the bracket open close i copy half code of javascript file, this is a javascript file when I run application I will gives error on line:6 (count from 1st line) so how can I solve the problem...?? If you need any other file then tell me... Actually I am new here..!! javascript share|improve this question edited Oct 17 '13 at 12:34 asked Oct 17 '13 at 11:25 Anup Karanjkar 317 1 I bet there is no 'pIDType_2' element in your HTML. –Etienne Miret Oct 17 '13 at 11:34 yes yes u right Actully this is only IDtype_2, IDDamille_2 & IDMode_2, –Anup Karanjkar Oct 17 '13 at 12:06 Please Help me anyone I am very upset, please solve that problem its gives error.... –Anup Karanjkar Oct 17 '13 at 12:18 1 Please show your HTML. The part where are the elements IDType_2 and so on. –Etienne Miret Oct 17 '13 at 12:41 we cant help without seeing the html. show your HTML with relevant tags –999k Oct 17 '13 at 12:48 add a commen
Sign in Pricing Blog Support Search GitHub This repository Watch 34 Star 181 Fork https://github.com/zikula/core/issues/415 74 zikula/core Code Issues 169 Pull requests 1 Projects http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/internet-explorer-80-error-object-required/df3e927d-c74b-4a03-bf18-3c47f17ae151 1 Wiki Pulse Graphs New issue in IE8, clicking on a submit button, gives js error 'Object required' #415 Closed tfotis opened this Issue May 25, 2012 · 2 comments Projects None yet Labels Bug Milestone 1.3.4 object required Assignees jusuff 2 participants Zikula Project member tfotis commented May 25, 2012 to replicate go to Settings module (index.php?module=settings&type=admin&func=modifyconfig) and press save. you will see the error in the bottom-left corner of the browser. the full error is: Message: Object required Line: 363 Char: 17 Code: 0 URI: http://example.com/javascript/helpers/Zikula.js object required .js jusuff was assigned Jun 23, 2012 Zikula Project member jusuff commented Jun 24, 2012 @tfotis does this error occur each time you click save or only in sometimes? Asking, because I cannot reproduce it. Zikula Project member tfotis commented Jun 25, 2012 yes it happens every time i click 'Save'. maybe it doesn't occur with every version of IE8. mine is 8.0.6001.18702. Windows XP SP3 i tried to track down the issue... the error is in function Zikula.fixbuttons in file javascript/helpers/Zikula.js it looks like b.attributes.getNamedItem('value') is null jusuff added a commit that closed this issue Jul 4, 2012 jusuff #415