|
Posted by Jukka K. Korpela on 05/08/07 15:38
Scripsit Adrienne Boswell:
>>> What's a better way to control the width of an input box? To use
>>> "width", as in style="width: 200px", or size as in <input size=25>?
>>
>> Surely the latter, since as an author, you can estimate the typical
>> length of input in characters but not in pixels. For all that you can
>> know, 200px might correspond to 4 or 40 characters.
>
> Agreed, as well as, as an author you may need to limit the user to a
> certain number of characters, if for instance, the information is to
> be posted to a database. Of course, in that case, you would also
> want to check the size of the data server side.
And then you would also want to use the attribute maxlength="25", which will
limit the amount of characters. Browsers enforce this, but it still cannot
be relied on, since a user could create a copy of the page with that
attribute removed.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
[Back to original message]
|