The moose likes HTML, CSS and JavaScript and the fly likes Netscape - Input Boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Netscape - Input Boxes" Watch "Netscape - Input Boxes" New topic

Netscape - Input Boxes

Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Input boxes in netscape (4.7) appear way wider than they actually are. I did set the size and maxLength attributes. They still appear too wide. The are displaying okay in IE. I have an input box of size 50. It's taking up almost the whoel width of the screen. Please let me know if there is a way to adjust it.

Thanks, Bosun

So much trouble in the world -- Bob Marley
Brian Glodde
Ranch Hand

Joined: Jun 27, 2001
Posts: 171
For Netscape, you're stuck with the old school size tag. It doesn't listen much to CSS. I have solved the cross browser form problems one of two ways: Detect the browser on the server side and then output the appropriate code -or- detect the browser on the client side and either assign a separate CSS or write the appropriate code via javascript. hope that helps.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

sorry buy my evil side just appeared...hahahahaha

Visit my download page
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

truely im sorry but its just that i have been in your shoes too many times
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You can come around this.
If your using asp ( maybe with javascript )
do a browsercheck in asp
function BrowserWrite( ieString , nnString )

BrowserWrite = ""

If Instr ( LCase( Request.ServerVariables( "HTTP_USER_AGENT" ) ) , "ie" ) > 0 Then

BrowserWrite = ieString


BrowserWrite = nnString

End If

end function
now when you will set an length on an textfield you invoke it by using
<input type="text" value="testing" size="<%= BrowserWrite( intIe , IntNS )%>">
Hope this helps
xavier romea
Ranch Hand

Joined: Jun 28, 2001
Posts: 37
The size of an input textbox is set in character so it depends of the size of the font of the page.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You should still use style sheets. Netscape formats the input boxes buttons to the font-size of the style sheet. After that you could set the size with an example of browsertype.
Tara O'Shea

Joined: Jun 20, 2001
Posts: 5
You can use a style tag in the INPUT tag, and that should work just find. Rather than using the size="" attribute, try style="width: 100px; height: 14px" or whatever the dimensions you want the input box to be....
subject: Netscape - Input Boxes
It's not a secret anymore!