Dynamically creating row question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jonpfl
    New Member
    • Feb 2007
    • 31

    Dynamically creating row question

    All,

    I am new to javascript and I am having problems dynamically creating rows and setting attributes.

    The following works on IE7.x but not IE6.x. Is there another way of creating a checkbox (via js) and have it checked by default that works in both 6.x and 7.x

    Following is the code I have :

    var inp1 = document.create Element("INPUT" );
    inp1.setAttribu te("type", "checkbox") ;
    inp1.setAttribu te("name", "TentCheck" );
    inp1.setAttribu te("checked", true);

    This works fine in 7.x but not 6.x

    Any ideas?

    Also, I cannot get the the 'maxlength' property to work at all in 7.x

    Following is my code
    var inp3 = document.create Element("INPUT" );
    inp3.setAttribu te("type", "input");
    inp3.setAttribu te("size", "8");
    inp3.setAttribu te("maxlength" , "8");

    Thx
    jonpfl
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to The Scripts

    This problem was dealt with in a previous thread (see last post). Also, see this link.

    Comment

    Working...