DhtmlXtree throws 'undefined' is null or not an object in I

In the following code, I am able to correctly render the tree using FireFox and everything work great. When I test it in IE 7, I get the ‘undefined’ is null or not an object error. This is frustrating me to no end. I have isolated the error to the line

var mytree = dhtmlXTreeFromHTML(‘treeboxbox_tree’);



I haven’t done more debugging than that yet though.



Anyone have a Q&D solution?



Thanks

–S

^





<div

id=“treeboxbox_tree”

setImagePath=“/images/imgs/”

enableCheckBoxes=“true”

enableThreeStateCheckboxes=“true”

enableDragandDrop=“false”

style=“width:350px; height:260px;overflow:auto;padding_left:70px;”>





  • Canada













  • United States



      <script language=speedscript">



      for each servicearea no-lock break by region by state:

      if first-of(region) then {&out} ‘
    • ’ region ‘
        ’.

        {&out} ‘<li id="’ state ‘"’.

        if hasbkcarr and index(bkcarr.state,servicearea.state) <> 0

        then {&out} ‘checked=“1”’.

        {&out} ‘>’ servicearea.state ’ ’ from_zip ’ ’ to_zip ‘’.

        if last-of(region) then {&out} ‘
    • ’.

      end.









  • Mexico














var mytree = dhtmlXTreeFromHTML(‘treeboxbox_tree’);



mytree.attachEvent(“onCheck”,onNodeSelect);



function onNodeSelect(nodeId){

document.servform.stateserv.value=mytree.getAllChecked();

alert(document.servform.stateserv.value);

}

The case of attribute must be the same as in original command
    <div
… enableDragAndDrop=“false”   
but this is minor issue , which must not cause js error.

Most pobably js error caused by the UL|LI structure. If there are some incorrectly placed UL or LI tags - the mentioned problem may occurs.
If error still occurs for you please exact HTML output of your script, because it is not really clear with current script code.