YAFLogo

RickshawDriver
15 years ago
When the value of the xhtmlConformance is changed in the web config to "Strict" from "Transitional" this bug shows itself.

Error: 'ctl00_ContentPlaceHolder1_forum_ctl01_scrollLeft' is null or not an object

I am using master pages as you can probably tell by the ContentPlaceHolder portion of the error. I will be happy to provide any other information from logs, etc if it will help.


RickshawDriver
Sponsor
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
15 years ago
Thanks for the bug report... I'll try to reproduce.

EDIT: Cannot seem to reproduce. Seems like it might be an incompatibility with your master page setup.

AdamWillden
15 years ago
Sorry to dig this up but I also have this problem in IE

checking on web developer in IE8 (using all modes: 7, 8 and 8 computability mode)

function yaf_GetForm() doesn't return the form as its supposed to so the function below doesn't work because cForm is not defined. Its should be simple code and so I doubt its a masterPage problem.

  function yaf_SmartScroller_Scroll()
  {
    var cForm = yaf_GetForm();
    var x = cForm.ctl00_ctl00_ctl00_ContentPlaceHolderDefault_mainContentPlaceHolder_yafForum_ctl01_scrollLeft.value;
    var y = cForm.ctl00_ctl00_ctl00_ContentPlaceHolderDefault_mainContentPlaceHolder_yafForum_ctl01_scrollTop.value;
		if (x || y) window.scrollTo(x, y);
		if (oldOnLoad != null) oldOnLoad();
  }

I'll try and look into this more as to why the form isn't returned properly but right now I have a lecture. I'm quite proficient at JS.

Can I ask what the scroller thing is and whether it can be simply disabled for now to remove this error.

AdamWillden
15 years ago
I did some JS debugging in IE this is the code causing the error by not returning theform:


  function yaf_GetForm()
  {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
    {
	  theform = document.aspnetForm;
    }
    else {
	  theform = document.forms["aspnetForm"];
    }
    return theform;
  }

Could you show me the file this code comes from?

I'm fairly sure that rather than testing for microsoft you should test for the "document.aspnetForm" or at least I read that it's better practice to do it this way. I tested the code below in the debugger and it returned the form using "document.forms["aspnetForm"];" (which I know is odd cause its IE)


  function yaf_GetForm()
  {
    var theform;
    if (document.aspnetForm)
    {
	  theform = document.aspnetForm;
    }
    else {
	  theform = document.forms["aspnetForm"];
    }
    return theform;
  }

This support forum doesn't seem to have the JS which causes the error.