PDA

View Full Version : maxlength in pixels, instead of characters?



F.N.G.
01-17-2003, 01:50 AM
Hello,

Can something like "maxlength" be applied to a text field, in such a way that it limits text input to the width, in pixels, of the text box, rather than the number of characters that can be entered?

MCookie
01-17-2003, 03:12 AM
You need some scripting for that:
http://www.faqts.com/knowledge_base/view.phtml/aid/3579/fid/55

oracleguy
01-17-2003, 04:23 AM
you also can just do:

<input type="text" style="width: 400px;" name="mytext" />

F.N.G.
01-17-2003, 04:24 AM
That script seems to mimic maxlength, by limiting character input, but doesn't really define pixel width...

thanks for the link, though.

oracleguy
01-17-2003, 04:26 AM
Then combine the script with the CSS I posted above. Or is that not what you are going for?

F.N.G.
01-17-2003, 04:31 AM
you also can just do: <input type="text" style="width: 400px;" name="mytext" />

The text field has style applied to it, but that doesn't seem to keep the text confined to that width.