The <input> tag: should one use "width" or "size"?
am 08.05.2007 00:16:15 von aaronfudeHi,
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 ?
Thanks!
Aaron Fude
Hi,
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 ?
Thanks!
Aaron Fude
Scripsit aaronfude@gmail.com:
> 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 ?
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.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Gazing into my crystal ball I observed "Jukka K. Korpela"
news:BVW%h.160412$HE1.86966@reader1.news.saunalahti.fi:
> Scripsit aaronfude@gmail.com:
>
>> 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 ?
>
> 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.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
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 ?
>>
>> 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/
"Jukka K. Korpela"
> 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.
.... or submit the form with something that isn't a browser. :-)
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net