By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,728 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,728 IT Pros & Developers. It's quick & easy.

Dynamically creating row question

P: 31
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.createElement("INPUT");
inp1.setAttribute("type", "checkbox");
inp1.setAttribute("name", "TentCheck");
inp1.setAttribute("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.createElement("INPUT");
inp3.setAttribute("type", "input");
inp3.setAttribute("size", "8");
inp3.setAttribute("maxlength", "8");

Thx
jonpfl
Feb 5 '07 #1
Share this Question
Share on Google+
1 Reply

acoder
Expert Mod 15k+
P: 16,027
Welcome to The Scripts

This problem was dealt with in a previous thread (see last post). Also, see this link.
Feb 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.