• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts html text size attribute

 
Stephanie Johnson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have defined a textbox in JSP as follows.
<html:text property="test" size="25" />

This gives me a textbox of visbile length 20 characters in upper case and 27 characters in lowercase in firefox.
By visible - I mean the total number of characters the user can see in the textbox without scrolling.
The lengths are different in IE.

Is there a way I can specify the textbox to show only 25 characters irrespective of whether it is upper / lower case or IE/firefox.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "size" attribute controls visual size; while "maxlength" controls the number of characters. If you want to control the size absolutely you're better off doing it in em/pixels/etc. to make it cross-browser.

Further discussion regarding input element sizing belongs in the HTML forum, as it doesn't really have anything to do with Struts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic