Change Field Length Programatically

Is there a way to change the length of a text field programatically?

Based on the userlevel for the user, I want to text field to be 20 characters long, and for others 40 characters long.

It would be perfect if it could show remaining characters also.

Re: Change Field Length Programatically

I’m not sure about changing the length, but you could probably do the characters left yourself somehow, using an ajax_onchange event.

Re: Change Field Length Programatically

Has anyone found a way to limit the field length in the form so I can have different lengths depending on the level of my user?

Re: Change Field Length Programatically

I would imagine you could use JS to change the field width.

if (user.level == 9) {
var textbox = document.F1.getElementById(“textBox”);
textbox.style[“width”] = “20px”;
}

This has not been tested.

Regards,
Scott.