This is an approximate measure at best. You cannot be sure how wide this box really needs to be when using a proportionally spaced font in it. The browser will size the box close to an optimal size to cope with the specified number of characters.
It can be quite distracting if the box size is too small to accommodate the maxLength number of characters. This can leave the user having to do some cumbersome select actions with the mouse or use arrow keys to reveal the hidden parts of the textual content of the box.
See also: | Input.size, TextCell.size |
Prev | Home | Next |
Password.select() | Up | Password.type |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |