Browser Issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • junal
    New Member
    • Jan 2007
    • 22

    Browser Issue

    hey guess ....im having some problem with my browser. my script runs well in FF but it saisy object null in IE....plz can anybody see this code and tell me where i did make mistake ? here im trying to create dynamic rows by onclick. another function whick is belongs to another table will create more columns depending to the rows. so what im trying to do is im calling the function at the end of the function so that it can dynamically change.

    THIS IS THE FUNC that im calling at the end of another function -->

    Code:
    func test (id)
           var hmrc=0;
    	var newrow;
    	var tbl;
    	var newcol , newinput;
    	
    	var loopcounter=0;
    	tbl = doc.getElementById(id);
    	//create a new row
    	newrow = doc.createElement("TR");
    	newcol = doc.createElement("TD");
    	newcol.width = 80;
    	newrow.appendChild(newcol);
    	
    	
    		while ( loopcounter<x ){
    		newcol = doc.createElement("TD");
    		newcol.width = 80;
    		//newcol.setAttribute((document.all ? "className" : "class"), "dtext");
    		newcol.innerHTML = col1[loopcounter];
    		newrow.appendChild(newcol);
    		loopcounter++;
    		
    		}
    	tbl.appendChild(newrow);
    	__uid1++;	
    	
    	var loopcounter=0;
    	tbl = doc.getElementById(id);
    	//create a new row
    	newrow = doc.createElement("TR");
    	newcol = doc.createElement("TD");
    	newcol.width = 80;
    	newrow.appendChild(newcol);
    	
    		while ( loopcounter<x ){
    		
    		newcol = doc.createElement("TD");
    		newcol.width = 80;
    		newcol.innerHTML =col2[loopcounter];
    		newrow.appendChild(newcol);
    		loopcounter++;
    		
    		}
    	tbl.appendChild(newrow);
    	__uid1++;	
    	
    	h=parseInt (doc.getElementById('hrm').value);
    	//alert(h);
    	
    	
    		var ii= 0;
    		var jj = 0;
    		while (hmrc<h){
    		
    					loopcounter=0;
    				
    					newrow = doc.createElement("TR");
    					newcol = doc.createElement("TD");
    					newcol.width = 80;
    					newcol.innerHTML="Test "+hmrc;
    					newrow.appendChild(newcol);
    					
    						jj = 0;
    						while ( loopcounter<x ){					
    								newcol = doc.createElement("TD");
    								newcol.width = 80;
    								newinput = doc.createElement("input");
    								newinput.name = "data[test]["+loopcounter+"]["+hmrc+"]";
    								newinput.size = 15;
    								newinput.value = "0";
    								newinput.id = "input"+ii+jj;
    								newcol.appendChild(newinput);
    								newrow.appendChild(newcol);
    								loopcounter++;
    								
    								jj ++;
    					}	
    					
    			tbl.appendChild(newrow);
    			hmrc++;
    			ii++;	
    				
    		}
    		
    	}


    at the end of another function im calling above function like this --->

    Code:
    if(doc.getElementById('showchart').value=="Refresh"){
    		test('testbody');
    		}
    this is the HTML table where table will be changed dynamically ....

    [HTML] <div id="hidesave" style=" width:620px; height:178px;ov erflow-x:auto; overflow-y:auto;" class="listform table">
    <table border="0" title="Show Chart">
    <!--DWLayoutTable-->
    <tbody id="testbody">

    </tbody>
    </table>
    </div>[/HTML]

    Please post code in tags - moderator

    guys it works fine in FF ....but IE !...plz help me !!
    thanks in advance ...:)
    Last edited by acoder; Apr 2 '07, 08:00 AM. Reason: Code in tags
  • junal
    New Member
    • Jan 2007
    • 22

    #2
    Originally posted by junal
    hey guess ....im having some problem with my browser. my script runs well in FF but it saisy object null in IE....plz can anybody see this code and tell me where i did make mistake ? here im trying to create dynamic rows by onclick. another function whick is belongs to another table will create more columns depending to the rows. so what im trying to do is im calling the function at the end of the function so that it can dynamically change.

    THIS IS THE FUNC that im calling at the end of another function -->

    func test (id)
    var hmrc=0;
    var newrow;
    var tbl;
    var newcol , newinput;

    var loopcounter=0;
    tbl = doc.getElementB yId(id);
    //create a new row
    newrow = doc.createEleme nt("TR");
    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    newrow.appendCh ild(newcol);


    while ( loopcounter<x ){
    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    //newcol.setAttri bute((document. all ? "className" : "class"), "dtext");
    newcol.innerHTM L = col1[loopcounter];
    newrow.appendCh ild(newcol);
    loopcounter++;

    }
    tbl.appendChild (newrow);
    __uid1++;

    var loopcounter=0;
    tbl = doc.getElementB yId(id);
    //create a new row
    newrow = doc.createEleme nt("TR");
    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    newrow.appendCh ild(newcol);

    while ( loopcounter<x ){

    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    newcol.innerHTM L =col2[loopcounter];
    newrow.appendCh ild(newcol);
    loopcounter++;

    }
    tbl.appendChild (newrow);
    __uid1++;

    h=parseInt (doc.getElement ById('hrm').val ue);
    //alert(h);


    var ii= 0;
    var jj = 0;
    while (hmrc<h){

    loopcounter=0;

    newrow = doc.createEleme nt("TR");
    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    newcol.innerHTM L="Test "+hmrc;
    newrow.appendCh ild(newcol);

    jj = 0;
    while ( loopcounter<x ){
    newcol = doc.createEleme nt("TD");
    newcol.width = 80;
    newinput = doc.createEleme nt("input");
    newinput.name = "data[test]["+loopcount er+"]["+hmrc+"]";
    newinput.size = 15;
    newinput.value = "0";
    newinput.id = "input"+ii+ jj;
    newcol.appendCh ild(newinput);
    newrow.appendCh ild(newcol);
    loopcounter++;

    jj ++;
    }

    tbl.appendChild (newrow);
    hmrc++;
    ii++;

    }

    }



    at the end of another function im calling above function like this --->

    if(doc.getEleme ntById('showcha rt').value=="Re fresh"){
    test('testbody' );
    }

    this is the HTML table where table will be changed dynamically ....

    <div id="hidesave" style=" width:620px; height:178px;ov erflow-x:auto; overflow-y:auto;" class="listform table">
    <table border="0" title="Show Chart">
    <!--DWLayoutTable-->
    <tbody id="testbody">

    </tbody>
    </table>
    </div>

    guys it works fine in FF ....but IE !...plz help me !!
    thanks in advance ...:)

    come on guys !!......

    Comment

    • Logician
      New Member
      • Feb 2007
      • 210

      #3
      Originally posted by junal
      hey guess ....im having some problem with my browser. my script runs well in FF but it saisy object null in IE....

      THIS IS THE FUNC that im calling at the end of another function -->
      You need to post either a URL or a runnable demo.

      Comment

      Working...