JavaScript - 'null Or Not An Object' In Form Processing
Hi
I have the below page. When form is submitted by clicking on the button the function checkform() is executed. Problem is that I am getting a 'entrystartday' is null or not an object error on line Code: if (frm.entrystartday.value == 31) { What is the problem and how can I fix it? Thanks Regards Code: <html> <head> <title>test</title> </head> <body> <form id="theform" action="main.asp" method="post" onsubmit="return checkform()"> <table style="width: 477px;"> <tr> <td style="vertical-align: top;" class="boldwhite"> Start Date </td> <td> <select id="entrystartday" name="entrystartday"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> / <select id="entrystartmonth" name="entrystartmonth"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> </select> / <select name="entrystartyear"> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> <option value="2013">2013</option> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2014">2016</option> <option value="2015">2017</option> </select> <span class="style1"><strong><= Select correct Start Date</strong></span> </td> </tr> </table> <table> <tr> <td class="style2"> <input type="submit" value="save" name="submit" /> </td> </tr> </table> <input type="hidden" name="view" value="<% = theview%>" /> <input type="hidden" value="save" name="a" /> <input type="hidden" value="<% = dateview %>" name="dateview" /> </form> <script type="text/javascript"> function checkform() { document.write("<P>right now 1: " + new Date() + "<P>"); var frm = document.forms["theform"]; if (frm.entrystartday.value == 31) { alert('I am here'); }; document.write("<P>right now 2: " + new Date() + "<P>"); }; </script> </body> </html> Similar TutorialsHi I am having trouble with a script. I cannot figure out why I get the message: error: null is null or not an object (In IE8) The site is: www.rayburns.com I have check the javascript for the navigation bar and for the rotating images and cannot see what is missing. Not sure what is not being called. Can someone please help with this. Thank you in advance! Hi i have done some reading on the net today because i am getting an error on ie. I did find the javascript twice in my code, once in the header and once here, so i removed it from the header. I also changed to src to the full url. But i am still getting this and i dont know why. the file is located in the root directory. Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SearchToolbar 1.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; msn OptimizedIE8;ENUS) Timestamp: Sat, 30 Jul 2011 16:03:05 UTC Message: 'null' is null or not an object Line: 8 Char: 3894 Code: 0 URI: http://www.mysite.com/swfobject.js Code: <script type='text/javascript' src='$CONST_LINK_ROOT/swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv'); s1.write('preview'); </script> <embed src='$CONST_LINK_ROOT/flvplayer.swf?file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv&autoStart=false' width='175' height='175' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed> would appreciate any suggestions thanks. i was on 1.5 swfobject i did download 2.2 and im guessing all you do is replace the swfobject.js file to upgrade it, but what happened is it gives me this now. Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SearchToolbar 1.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; msn OptimizedIE8;ENUS) Timestamp: Sat, 30 Jul 2011 16:31:08 UTC Message: 'SWFObject' is undefined Line: 1283 Char: 1 Code: 0 URI: http://www.mysite/video_admin.php?type=v i dont mind going back to the old version i just need to get this working and im soooooooo lost lol ok another update, this is becomming maddening lol. once i have this line in the header php Code: <script type='text/javascript' src='$CONST_LINK_ROOT/swfobject.js'></script> I never have to use it again as long as they header php is included correct? This is what is driving me nuts, im back on 1.5 and it says its undefined Code: but am in not defining it on this line? ---> var s1 = new SWFObject('player.swf','player','400','300','9'); <script type='text/javascript' src='swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv'); s1.write('preview'); </script> Another Update. I am back to the original question. null is null or not an object.. in my search i have found this found a solution. basically Internet Explorer is crappy and doesnt like the setAttribute property so had to change the onchange handler by directly changing the attrbute for the object like so. object.onchange = function() {} i have no idea what they means, does that mean i need to change swfobject.js or does that mean i have to change my xml request. and if it is the swfobject i have no clue what they mean or what lines Hi I've implemented Busybox on a website to display FLV files in a popup player. This works fine, except for the following error in IE (FF is fine) when I close the popup: 'null' is null or not an object I think I've narrowed it down to the following block of code, but am stuck as to what to do from here. Code: var cl = new Element('img',{ 'styles':{ width:'24px', height:'24px', position:'absolute', top:'-20px', right:'-20px', 'z-index':'100000' }, 'src':'bumpbox/closed.png', 'id':'closer' }) cl.addEvent('click',function(e){ e = new Event(e).stop(); bg.dispose(); $(el).getChildren().dispose(); eff2.start({ 'width':[maxw,1], 'height':[maxh,1], 'left': [endleft,middleH], 'top': [endtop, middleV+s] }) }) The IE error is just giving me line number 1 of the php, but the error, I'm sure, lays in the Javascript. Many thanks Hi, I am getting an error on this code - sometimes! - and I'm not sure what it is. If I run this as is there is no error. If I add it into another page with other stuff it's ok for a while and then I get an error. So, I added my new page block my block to this code and waited for the error to appear so I could determine a conflict - but it was fine. And then a few clicks later the error. This is the error in IE. In Firefox it seems to be fine lol. Line 159 Char 3 'window.document.sendform.message_text' is null or not an object Can someone make any suggestions? Code: <script language="JavaScript" type="text/javascript"> maxlen = 160; countLen(); function countLen() { message_text = window.document.sendform.message_text.value; realLength = message_text.length; if (realLength>maxlen) { realLength = maxlen; window.document.sendform.message_text.value = message_text.substring(0,maxlen); } message_text = window.document.sendform.message_text.value; // del enter var m = message_text.match(/[\r\n]/); if (m !== null) { window.document.sendform.message_text.value = message_text.replace(/[\n\r]/g, '') } window.document.sendform.messlen.value=maxlen-realLength; } </script> <cfset thismessage = "Hi, is this a start"> <cfform action="step2.cfm" method="post" id="sendform" name="sendform"> <cfoutput><textarea id="styled" name="message_text" onkeypress=countLen() onkeydown=countLen() onkeyup=countLen() onchange=countLen() onmouseover=countLen() rows="4">#thismessage#</textarea></cfoutput> <table width="331" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="5"></td> <td width="26"><cfoutput> <input name="messlen" type="text" value="160" class="counterField" onFocus="this.form.message_text.focus();" /></cfoutput></td> <td width="300">characters remaining</td> </tr> </table> </cfform> Thanks! Much appreciated! Kind regards, jo Hello, I'm working on web apps for a company and unfortunately the websites work in Mozilla, chrom and IE9 but not in IE8. In IE8 the error message "undefined is null or not an object" is pointing to this line: temp = val.replace(/-/g, "/"); That line is inside a function. I'm not sure how to troubleshoot this...any help would be appreciated. I have a bug that is only seeming to effect IE 8:. It seems to have a problem with this line: theSelectBox.selectedIndex = -1; This is where my full page is: http://www.mauirealestate.net/advancedsearch-rets.php Also has a weird display issue in IE8, but not in "compatibility view", which the bug may fix. Works and looks beautiful is Safari and Firefox. Any suggestions are helpful. Hello, I'm having a TypeError problem. Basically I've got scripts which seem to work fine and don't spit out any errors. There is a contact page... which has a form, and on clicking submit... you can sent to another page generated with a php header and footer and then some custom info based on if you filled everything out correctly or not. In any event, when you get sent to this page it's not really showing up because of some TypeError from the same script that works everywhere else and I can't figure it out. It's specific to the following js. Code: (evaluating 'nav_toggle.addEventListener') which is in the following function Code: // nav toggle function initNavToggle() { // classie toggle var nav = document.querySelector('nav.nav-main'), nav_toggle = document.querySelector('a.nav-toggle'); nav_toggle.addEventListener('click', function(e){ e.preventDefault(); classie.toggle(nav, 'open'); classie.toggle(nav_toggle, 'toggle-back'); }); // toggle burger switch document.querySelector( '.nav-toggle' ).addEventListener( 'click', function() { this.classList.toggle( 'active' ); }); } which pertains to the following html Code: <a href="#" class="nav-toggle">Menu</a> <nav class="nav-main"> <ul> <li><a href="/">A</a></li> <li><a href="/">B</a></li> <li><a href="/">C</a></li> <li><a href="/">D</a></li> </ul> </nav> Is it possible that because the nav html is in the header and being assembled via php that the script is firing before the html exists? Reply With Quote 01-09-2015, 09:56 PM #2 wyclef View Profile View Forum Posts Regular Coder Join Date Feb 2005 Posts 239 Thanks 9 Thanked 0 Times in 0 Posts Well, I guess I just answered my own question because I tried taking the script from the footer and putting it in the header and now everything works. Not understanding what is going on here really. Using FormM@iler | LAMP Application Developer, UI/UX, SEO PHP FormM@iler. Guess hold off looking at this until I examine things further. Reply With Quote 01-09-2015, 10:29 PM #3 Old Pedant View Profile View Forum Posts Supreme Master coder! Join Date Feb 2009 Posts 28,311 Thanks 82 Thanked 4,754 Times in 4,716 Posts The code inside a function can't fire until the function is invoked. So where is the function invoked? Where does classie come from? You don't show it. Hello all. I am trying to track down why this custom validator is failing with an error that args is undefined. There are two funnctions - one works and one does not. Here they a the bold italicized item is where the error is being generated. Function validHygieneNote works as expected however. Code: function validClothingNote(val,args) { var radio_choice = false; var chks = document.getElementById('clothingNote'); var chks2 = document.getElementsByName('clothingInadequate'); for (counter=0; counter < chks2.length; counter++) { if (chks2[counter].checked){ var rad_val =chks2[counter].value; }} if((rad_val==1)|| (rad_val==2)) { if ((chks.value=="") || (chks.value.length==0) || (chks.value==null)){ args.IsValid=false; } else { args.IsValid = true; } }} function validHygieneNote(val,args) { var radio_choice = false; var chks = document.getElementById('hygieneNote'); var chks2 = document.getElementsByName('hygieneInadequate'); for (counter=0; counter < chks2.length; counter++) { if (chks2[counter].checked){ var rad_val =chks2[counter].value; }} if((rad_val==1)|| (rad_val==2)) { if ((chks.value=="") || (chks.value.length==0) || (chks.value==null)){ args.IsValid=false; } else { args.IsValid = true; } }} I am not very experienced at javascript. Having trouble with some I used for a google map on some of the pages on company site. Appreciate any assistance someone out there could give. If you go to http://www.ghd.com/global/locations/...nsland/cairns/ you can see the error. Get the debug message: an error occurred on this page: Line: 74 Character: 9 Error: GetElementById(....)' is null or not an object The map is actually in a i frame For some reason in ie 6 this script error is popping up when the page loads, but does not when not shown within a iframe http://www.ghd.com/map/cazenovia.html Hi I am using a custom form elements script in the link below: www_bristolstreet_co_uk/page/find_a_dealer.htm and an error for null object is appearing from this line: active = option[0].childNodes[0].nodeValue; Can anyone please help? I am a novice at Javascript but got this script working perfectly on my local machine - once I loaded it the live site it didn't work... any advice would be greatly appreciated. Hello I am using a timer which goes down from 2 minutes to zero when 'jsp' is called. Timer is written in javascript. I am getting an error that document.form1.timerMin.value=<%=min%> is null or not an object. Here is the code (t.jsp): <% /* Default timer */ int min = 2; int sec = 5; /* Check for timer params */ try { String timerMin = request.getParameter("timerMin"); if (timerMin==null)timerMin=""; if (timerMin != null) { min = Integer.parseInt(timerMin); } String timerSec = request.getParameter("timerSec"); if (timerSec==null)timerSec=""; if (timerSec != null) { sec = Integer.parseInt(timerSec); } } catch(Exception m) { System.out.println("generated exception..............:"+m); } %> <script language="JavaScript" type="text/javascript"> <!-- /* Initialise timer */ var min = <%=min%>; // set the minutes var sec = <%=sec%>; // set the seconds function countDown() { sec--; if (sec == -1) { sec = 59; min--; } /* Write timer state to hidden form fields */ document.form1.timerMin.value=<%=min%> document.form1.timerSec.value=<%=sec%>; time = (min<=9 ? "0" + min : min) + " min and " + (sec<=9 ? "0" + sec : sec) + " sec "; document.getElementById('theTime').innerHTML = time; SD=window.setTimeout("countDown()", 1000); if (min == 0 && sec == 0) { window.clearTimeout(SD); } } window.onload = countDown(); --> </script> <style type="text/css"> <!-- .timeClass { font-family:arial,verdana,helvetica,sans-serif; font-weight:normal; font-size:10pt; } --> </style> <table width="100%"> <tr><td width="100%" align="right"> <span id="theTime" class="timeClass"></span> </td></tr> <form method="post" name="form1" id="form1" action="t.jsp" <td width="50%" valign="middle"> <input type="hidden" name="timerMin" value="<%=min%>"> <input type="hidden" name="timerSec" value="<%=sec%>"> <div align="center"><a href="javascript:form1.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','/lms/images/submit_0.gif',1)"><img name="Image3" border="0" src="/lms/images/submit_0.gif" width="70" height="30"></a></div> </td> </form> Looking forward for an early reply. Thanks Hi, I have added an validation script for Pizza menu. Validation working fine in all browsers except IE. When I working in IE8 it throws an error "length is null or not an object error in IE8". Please help me. See Java script code below: <script> function UnCheckRadios(radioButtonGroupName) { var formName = "frmOrder"; var form = document.forms[formName]; alert(form); var noOfRadioButtons=form[radioButtonGroupName].length; for(var x=0;x<noOfRadioButtons;x++) { chk=form[radioButtonGroupName] .checked=false; } } </script> PHP code: <input type="radio" id="<?=$subitem['subgroup_id'];?>_comboleft" name="<?=$subitem['subgroup_id'];?>_comboleft" value="<?=$subitem['id'];?>:Left Side" onclick="UnCheckRadios('<?=$subitem["subgroup_id"];?>_combowhole');"> Featured Content Slider v2.4 and RSS Display Box (on same page) Tested on Firefox, Chrome, IE7 and IE8, for some reason I get this error on one of the pages, one exact duplicate works fine. 'contentdivs[...].style' is null or not an object I don't have this online. Any ideas? Edit: I thought I solved it but mistaken. rssdisplaybox.js line 25 -> Red slash removed as the image was already in the same folder. Code: this.loadingHTML='<img src="'+rssoutputscript.replace('main.php', '')+' / loading.gif" /> Initializing RSS Display Box...' //Specify HTTML to show while feed is being fetched Featuredcontentslider version is attached. I am trying to troubleshoot my javascript function below. Code: <script type="text/javascript"> function txtboxfill(fillobj) { var rChar=String.fromCharCode(13); var myVal = "To: " + this.form.to.value + rChar; myVal = myVal + "From: " + this.form.from.value + rChar; myVal = myVal + "Subj: " + this.form.subj.value + rChar + rChar; myVal = myVal + "Message: "; fillobj.value = myVal; } </script> Then I have a text box input field with an Code: <input type="text" id="tp" name="to" size="34" class="totext" onkeyup="txtboxfill(this.form.msg_area);"> and when I enter text in this field it gives me a 'this.form.to' is null or not an object and does not populate the textarea. BTW, msg_area is the id of my textarea. Thank you. I have a button you should be able to click on it once and have one new page open into ID 1 then you should be able to click on it again and have a second page load into ID 2. Sometimes it works sometimes it doesnt. I have no idea why. The script is below. I highlighted the bits I think relevant. When it doesn't work I get the error message: document.getElementById(...)' is null or not an object Mainpage: Code: <?php session_start(); if (!(isset($_SESSION[login]) && $_SESSION[login] !='')){ header ("Location: Welcome.php"); } $Sfullname=$_SESSION['fullname']; $SMyPId=$_SESSION['MyPId']; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <title>Chat</title> <head> <link rel="stylesheet" type="text/css" href="eightysixdegreesstyle.css" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function (){ $('#submitchat1, #submitchat2, #submitchat3, #submitchat4, #submitchat5').live('click',function(){ var btn = $(this).attr('id'); var Frm; if(btn == 'submitchat1'){ Frm = '#chatmessage1'; } else if(btn == 'submitchat2'){ Frm = '#chatmessage2'; } else if(btn == 'submitchat3'){ Frm = '#chatmessage3'; } else if(btn == 'submitchat4'){ Frm = '#chatmessage4'; } else if(btn == 'submitchat5'){ Frm = '#chatmessage5'; } var data = $(Frm).serialize(); $.post ('insertChat.php',data, function(){ $(Frm).each (function(){ this.reset(); }); return false; }); }); $('#maximizeChat1, #maximizeChat2, #maximizeChat3, #maximizeChat4, #maximizeChat5').live('click',function(){ var btn = $(this).attr('id'); var Display; if(btn == 'maximizeChat1'){ Display = '#ChatDisplayOne'; } else if(btn == 'maximizeChat2'){ Display = '#ChatDisplayTwo'; } else if(btn == 'maximizeChat3'){ Display = '#ChatDisplayThree'; } else if(btn == 'maximizeChat4'){ Display = '#ChatDisplayFour'; } else if(btn == 'maximizeChat5'){ Display = '#ChatDisplayFive'; } $(Display).slideToggle("slow"); }); }); </script> <style type="text/css"> /*<![CDATA[*/ #chat1 { display:block; } #chat2 { display:block; } #chat3 { display:block; } #chat4 { display:block; } #chat5 { display:block; } /*]]>*/ </style> <script type="text/javascript"> function loadChat(File,ID,Msg,TID,Cile){ loadChatComplex(File,ID,Msg); delay = setTimeout(function(){loadChatRefresh(Cile,TID,Msg)},5000); } </script> <script type="text/javascript"> function OpenChat(File,LID,Msg,Dsg,Sile,SID,Wile,WID,Wsg){ loadChatComplex('getUpdateNew.php','txtHingNoNew',Dsg); breath = setTimeout(function(){loadChatTalkComplex(File,LID,Msg)},1000); lalker = setTimeout(function(){loadChatTalkComplex(Sile,SID,Wsg)},3000); talker = setTimeout(function(){loadChatTalkRefresh(Wile,WID,Wsg)},5000); } </script> <script type="text/javascript"> function loadChatCheck(File,ID,Tile,TID){ loadQuickCheck(File,ID); dodo = setTimeout(function(){loadQuickMessageCheck(Tile,TID)},3000); } </script> <script type="text/javascript"> function closeChat(ID,File,LID,Msg){ loadChatComplex(File,LID,Msg); document.getElementById(ID).style.display="none"; } </script> <script type="text/javascript"> function loadChatComplex(File,ID,Msg){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } var params=Msg; xmlhttp.open("POST",File,true); xmlhttp.setRequestHeader("Pragma", "Cache-Control:no-cache"); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } </script> <script type="text/javascript"> function loadChatTalkComplex(File,ID,Msg){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } var params=Msg; xmlhttp.open("POST",File,true); xmlhttp.setRequestHeader("Pragma", "Cache-Control:no-cache"); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } </script> <script type="text/javascript"> function loadChatRefresh(File,ID,Msg){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; ticker = setInterval(function(){loadChatRefresh(File,ID,Msg)},3000); } } var params=Msg; xmlhttp.open("POST",File,true); xmlhttp.setRequestHeader("Pragma", "Cache-Control:no-cache"); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } </script> <script type="text/javascript"> function loadChatTalkRefresh(File,ID,Msg){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { try{ xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; ticker = setInterval(function(){loadChatRefresh(File,ID,Msg)},3000); } } var params=Msg; xmlhttp.open("POST",File,true); xmlhttp.setRequestHeader("Pragma", "Cache-Control:no-cache"); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.send(params); } </script> <script type="text/javascript"> function loadChatBasic(File,ID){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST",File,true); xmlhttp.send(); } </script> <script type="text/javascript"> function loadQuickCheck(File,ID){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; malaky = setInterval(function(){loadQuickCheck(File,ID)},5000); } } xmlhttp.open("POST",File,true); xmlhttp.send(); } </script> <script type="text/javascript"> function loadQuickMessageCheck(File,ID){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; whistle = setInterval(function(){loadQuickCheck(File,ID)},5000); } } xmlhttp.open("POST",File,true); xmlhttp.send(); } </script> </head> <body onload="loadChatCheck('getCheckNewMessages.php','txtHintCheckNewMessage','getFriendsOnline.php','txtHintShowFriends')"> <div class="mainpage"> <table border="0" width="100%"> <tr> <td> <h1>Thanks</h1> <?php echo "Hi " . $Sfname;?> <br /> </td> <td> <div class="right"> <input type="text" name="search" class="input" value="search" size="40" onclick="clearMe(this)" onkeyup="ShowHint(this)"> <br /> <div id="txtMainSearchHint"></div> </div> </td> </tr> </table> <hr /> <br /> <br /> <div> <div class="pageleft"> <p>Friends Online:</p> <br /></br /> <div id="txtHintShowFriends"></div> <div id="txtHintEndChat"></div> <div id="txtHintCheckNewMessage"></div> <div id="txtHingNoNew"></div> <div id="txtHintClearChat"></div> <br /><br /> <input type="button" value="Clear All" onclick="loadChatBasic('getClearChat.php','txtHintClearChat')" /> <br /><br /> <div class="chat1" id="chat1">Space Holder</div> <div class="chat2" id="chat2">Space Holder</div> <div class="chat3" id="chat3">Space Holder</div> <div class="chat4" id="chat4">Space Holder</div> <div class="chat5" id="chat5">Space Holder</div> <br /> <br /> </div> <div class="pageright"> <?php include("SideBar.php"); ?> </div> </div> <div class="clear"></div> <br /> <br /> <?php include("footer.php"); ?> </div> getFriendsOnline.php PHP Code: <?php session_start(); if (!(isset($_SESSION['login']) && $_SESSION['login'] !='')){ header ("Location: Welcome.php"); } $SMyPId=$_SESSION['MyPId']; include("dbconnect.php"); $result = mysql_query("SELECT *, signedin.PId as SIPId FROM signedin INNER JOIN friends ON signedin.PId=friends.invited OR signedin.PId=friends.invitee WHERE ((friends.invitee={$SMyPId} AND friends.statae='accepted') OR (friends.invited={$SMyPId} AND friends.statae='accepted')) AND signedin.LogOff IS NULL AND signedin.PId !={$SMyPId}"); while($row = mysql_fetch_array($result)){ $mugwort= $mugwort . ';' . $row['SIPId']; } $motherwort=explode(';',$mugwort); foreach ($motherwort as $mulberry){ $result = mysql_query("SELECT COUNT(*) as divonecount FROM chat WHERE chatter='{$SMyPId}' AND chatterspace='chat1' AND EndDate IS NULL"); $row = mysql_fetch_assoc($result); $divonecount=$row['divonecount']; $result = mysql_query("SELECT COUNT(*) AS divtwocount FROM chat WHERE chatter='{$SMyPId}' AND chatterspace='chat2' AND EndDate IS NULL"); $row = mysql_fetch_assoc($result); $divtwocount=$row['divtwocount']; $result = mysql_query("SELECT COUNT(*) AS divthreecount FROM chat WHERE chatter='{$SMyPId}' AND chatterspace='chat3' AND EndDate IS NULL"); $row = mysql_fetch_assoc($result); $divthreecount=$row['divthreecount']; $result = mysql_query("SELECT COUNT(*) AS divfourcount FROM chat WHERE chatter='{$SMyPId}' AND chatterspace='chat4' AND EndDate IS NULL"); $row = mysql_fetch_assoc($result); $divfourcount=$row['divfourcount']; $result = mysql_query("SELECT COUNT(*) AS divfivecount FROM chat WHERE chatter='{$SMyPId}' AND chatterspace='chat5' AND EndDate IS NULL"); $row = mysql_fetch_assoc($result); $divfivecount=$row['divfivecount']; if($divonecount=='0'){ $showchat='chat1'; } elseif ($divtwocount=='0'){ $showchat='chat2'; } elseif ($divthreecount=='0'){ $showchat='chat3'; } elseif ($divfourcount=='0'){ $showchat='chat4'; } elseif ($divfivecount=='0'){ $showchat='chat5'; } [COLOR="Red"] if($showchat=='chat1'){ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="OpenChat(\'chatheader1.php\',\'chat1\',\'chat=' . $nightshade . '\',\'ChatID=0\',\'getDisplayChat1.php\',\'ChatDisplayOne\',\'getThisChat1.php\',\'displaytalkOne\',\'artemis=' . $nightshade . '\')" /><br /> '; } }elseif($showchat=='chat2'){ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="OpenChat(\'chatheader2.php\',\'chat2\',\'chat=' . $nightshade . '\',\'ChatID=0\',\'getDisplayChat2.php\',\'ChatDisplayTwo\',\'getThisChat2.php\',\'displaytalkTwo\',\'artemis=' . $nightshade . '\')" /><br /> '; } }elseif($showchat=='chat3'){ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="OpenChat(\'chatheader3.php\',\'chat3\',\'chat=' . $nightshade . '\',\'ChatID=0\',\'getDisplayChat3.php\',\'ChatDisplayThree\',\'getThisChat3.php\',\'displaytalkThree\',\'artemis=' . $nightshade . '\')" /><br /> '; } }elseif($showchat=='chat4'){ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="OpenChat(\'chatheader4.php\',\'chat4\',\'chat=' . $nightshade . '\',\'ChatID=0\',\'getDisplayChat4.php\',\'ChatDisplayFour\',\'getThisChat4.php\',\'displaytalkFour\',\'artemis=' . $nightshade . '\')" /><br /> '; } }elseif($showchat=='chat5'){ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="OpenChat(\'chatheader5.php\',\'chat5\',\'chat=' . $nightshade . '\',\'ChatID=0\',\'getDisplayChat5.php\',\'ChatDisplayFive\',\'getThisChat5.php\',\'displaytalkFive\',\'artemis=' . $nightshade . '\')" /><br /> '; } }else{ $result = mysql_query("SELECT * FROM allusers WHERE PId='{$mulberry}'"); while($row = mysql_fetch_array($result)){ $nosegay=rand(). rand(). rand(). rand(). rand(); $nightshade="{$SMyPId};{$mulberry};{$row['fullname']};{$nosegay}"; echo '<img src="thumbs/' . $row['pphoto'] . '" width="30px" /><input type="button" class="button10" name="frol" id="frol" value="' . $row['fullname'] . '" onclick="alert(\'You have reached your IM capacity, please close a chat box\')" ;> '; } } } [/COLOR] echo '<br /><div class="clear"></div><br /><br />'; mysql_close($con); ?> Or you can see it at : Website: eighty-sixdegrees.com Then Sign in; Username: guest@eighty-sixdegrees.com Password: abcdefgh123456 Click on chat in the header menu then wait five seconds for the boxes to load. Hi, I started getting a wierd problem with my jscript program. Here im using jscript for client-side validation and upon email field submission,im getting undefined value with an error saying "length is null or not an object". All the values of fields prior to that are being obtained properly. Please help me out of this crisis Hi , I have a an application which works fine on XP IE6, but the same application throws error " Java Script Error Style is null or not an object" on XP IE8 and Windows 7 . Please help me to resolve this issue. Please Tahnks in advance |