Categories | Question details Back To List | ||
Ok. Here is the generated code: <html> <head> <script src='/dhtmlxcommon.js'></script> <script src='/dhtmlXTree.js'></script> <script src='/dhtmlXTree_start.js'></script> </head> <body> <h1 align='center'>Update Country/Region/States Serviced</h1> <p/> <form action='updateservice.p' name='servform'> <input type='hidden' name='stateserv'/> <input type='hidden' name='carrier' value='106'/> <div class='dhtmlxTree' id='treeboxbox_tree' setImagePath='/images/imgs/' enableCheckBoxes='true' enableThreeStateCheckboxes='true' enableDragAndDrop='false' style='width:350px; height:260px;overflow:auto;padding_left:70px;'> <ul> <li id='canada' >Canada <ul> <li id='AB'>ALBERTA</li> <li id='BC'>BRITISH COLUMBIA</li> <li id='MB'>MANITOBA</li> <li id='NB'>NEW BRUNSWICK</li> <li id='NL'>NEW FOUNDLAND</li> <li id='NS'>NOVA SCOTIA</li> <li id='NT'>NORTHWEST TERRITORIES</li> <li id='ON'>ONTARIO</li> <li id='PE'>PRINCE EDWARD ISLAND</li> <li id='PQ'>QUEBEC</li> <li id='SK'>SASKATCHEWAN</li> <li id='YT'>YUKON</li> </ul> </li> <li>United States <ul> <li>Central <ul> <li id='KS'>KS - 660 679</li> <li id='ND'>ND - 580 588</li> <li id='NE'>NE - 680 699</li> <li id='SD'>SD - 570 577</li> </ul> </li> <li>Mid-Altantic <ul> <li id='DC'>DC - 200 205</li> <li id='DE'>DE - 197 199</li> <li id='MD'>MD - 206 219</li> <li id='VA'>VA - 220 246</li> <li id='WV'>WV - 247 268</li> </ul> </li> <li>Midwest <ul> <li id='IA'>IA - 500 528</li> <li id='IL'>IL - 600 629</li> <li id='IN'>IN - 460 479</li> <li id='KY'>KY - 400 427</li> <li id='MI'>MI - 480 499</li> <li id='MN'>MN - 550 567</li> <li id='MO'>MO - 630 659</li> <li id='OH'>OH - 430 458</li> <li id='WI'>WI - 530 549</li> </ul> </li> <li>Mountain <ul> <li id='CO'>CO - 800 819</li> <li id='MT'>MT - 590 599</li> <li id='WY'>WY - 820 831</li> </ul> </li> <li>Northeast <ul> <li id='CT'>CT - 60 69</li> <li id='MA'>MA - 10 27</li> <li id='ME'>ME - 39 49</li> <li id='NH'>NH - 30 38</li> <li id='NJ'>NJ - 70 89</li> <li id='NY'>NY - 100 119</li ><li id='NY'>NY - 120 149</li> <li id='PA'>PA - 150 196</li> <li id='RI'>RI - 28 29</li> <li id='VT'>VT - 50 59</li> </ul> </li> <li>Northwest <ul> <li id='ID'>ID - 832 839</li> <li id='OR'>OR - 970 979</li> <li id='UT'>UT - 840 849</li> <li id='WA'>WA - 980 994</li> </ul> </li> <li>Southeast <ul> <li id='AL'>AL - 350 369</li> <li id='FL'>FL - 320 349</li> <li id='GA'>GA - 300 319</li> <li id='MS'>MS - 386 399</li> <li id='NC'>NC - 270 289</li> <li id='SC'>SC - 290 299</li> <li id='TN'>TN - 370 385</li> </ul> </li> <li>Southwest <ul> <li id='AR'>AR - 720 729</li> <li id='LA'>LA - 700 719</li> <li id='NM'>NM - 870 884</li> <li id='OK'>OK - 730 749</li> <li id='TX'>TX - 750 799</li> <li id='TX'>TX - 885 885</li> </ul> </li> <li>West <ul> <li id='AZ'>AZ - 850 869</li> <li id='CA'>CA - 900 935</li> <li id='CA'>CA - 936 955</li> <li id='CA'>CA - 956 962</li> <li id='NV'>NV - 890 898</li> </ul> </li> </ul> </li> <li id='mexico'>Mexico </li> </ul> </div> <script language='javascript'> var mytree = dhtmlXTreeFromHTML('treeboxbox_tree'); mytree.attachEvent('onCheck',onNodeSelect); function onNodeSelect(nodeId){ document.servform.stateserv.value=mytree.getAllChecked(); alert(document.servform.stateserv.value); } </script> <input type='Submit' value='Submit' name='test'/> </form> </body> </html> I am still having the problem and from what I see, the code is correct. Answer posted by Support on Apr 28, 2008 05:58 The tree has two ways to be initialized from HTML a) by using special class name ( will init automatically on page loading ) b) by using dhtmlXTreeFromHTML command In your case both methods used which cause problem, to resolve it just remove class name from the div tag and all will work correctly. <div id='treeboxbox_tree' setImagePath='./codebase/imgs/' enableCheckBoxes='true' enableThreeStateCheckboxes='true' enableDragAndDrop='false' style='width:350px; height:260px;'> |