Controlling input field maxlength at runtime

I’ve been staying up too late…

Is there any way to code the maxlength value for an input field at runtime from within SC?

Thanks

Re: Controlling input field maxlength at runtime

Does ‘Field Size in Database’ make a difference?
There is also Maximum Size under Values Format

If you need to change the length at actual runtime, then I would suggest using JS.

Regards,
Scott.

Re: Controlling input field maxlength at runtime

Scott,
I want to control the maximum input length of a field according to a selection made by the user in a previous (listbox) field. Usually this is done by setting the maxlength parameter on the input field, as in
<input type=“text” name=“email” maxlength=“35” />

I was wondering if there was a way to implement this from the SC IDE?

Re: Controlling input field maxlength at runtime

Since SC gens the code, I am not sure you could do this in the IDE, except to put a value/variable in the placeholder for the size value then use JS to find the DOM element and make the changes in code to the document itself.

You would have to use firebug to get the element info.

Regards,
Scott.

Re: Controlling input field maxlength at runtime

Thanks. The code generator places the literal value declared at design time. Looks like I’ll need to get inventive.

Cheers