Reply to Re: The <input> tag: should one use "width" or "size"?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация