Login Register

how can I get the size value from a TextBox text field

I know that many people have commented that the TextBox widgets change the field size. They can only be changed with a style sheet specifying the width. I was hoping to get the size that was set in the input field so I could change the width proportional to that rather than have to create a width for each field's id.

Here's what I've got so far.

function changeSizes() {
        var custForm = dijit.byId("custForm");
        dojo.every(custForm.getDescendants(), function(elem) {
                var thisclass = elem.baseClass;
                var thisname = elem.name;
                var thisw = dojo.byId(thisname);
                alert ("class = " + thisclass + "; name = " + thisname + "; thisw = " + thisw);
                return false;
        });
}

I know if it's a TextBox from the baseClass and I can get the field name but I don't know how to access the size.