...

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



F.N.G.
01-17-2003, 12: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, 02:12 AM
You need some scripting for that:
http://www.faqts.com/knowledge_base/view.phtml/aid/3579/fid/55

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

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

F.N.G.
01-17-2003, 03: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, 03: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, 03: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum