Dynamic form: limit field length

I’m currently working on a dynamic form where an end-user can define his own field, type, default value and length. I managed most of it, but somehow I cannot limit the input length. In effect I would like to get effective:

Username: <input type=“text” name=“usrname” maxlength=“10”>

I created a javascript procedure with two params:

var sel = document.F1[fldName]; //get the select field
sel.maxLength=fldLength;

But this doesn’t work, I tried the ajax varant too without success. Is it possible? Strange thing is that altering width of the editfield itself

var sel = document.F1[fldName]; //get the select field
sel.size=fldWidth;

works

(It could be that the following is preventing the statement as it is generated within the html page: alt="{datatype: ‘text’, maxLength: 80, allowedChars: etc"

Yeah, it seems not to work. Even if you change both, the ‘maxlength=’ value and the ‘maxLength:’ value in the ‘alt’ attribute it is still being ignored and the original values are applied.
Sorry, don’t have a solution yet.

jsb