Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form text field attrib that controls width in NetScape

Status
Not open for further replies.

sfunk

Technical User
Jan 22, 2002
107
US
Can anyone help me with the attribute that will control the display width (not max chrs) when viewed in NetScape?

I can't remember anything about it, so posting an example would be a big help.

Thanks,
steve
 
Are you talking the size tag?

<input type=&quot;text&quot; name=&quot;textfield&quot; size=&quot;3&quot;>

That will make it 3 characters wide.
 
No I'm already using the size attrib. This works in ie but not netscape. In netscape, the text box shoots out to an uncontrollable length.
 
You should use a combination of css and size attribute.
Applying the text properties to the style of input field with css will set the font face and font size, while size will set the length of input field.

.txt1 { font: 8pt verdana,arial,sans-serif; width: 70px }

<input type=&quot;text&quot; class=&quot;txt1&quot; size=&quot;5&quot;>


width: 70px will set the size of input field in IE, Opera and Netscape6, while size=&quot;5&quot; along with font settings from class=&quot;txt1&quot; will do this for NN4.x.
This way you can make form elements look (almost) exactly the same in all browsers.

I always use this trick and it never fails.
good luck
 
I have encountered the same problems in trying to get form fields to appear the same in various browsers. I was not able to find a single solution to make things work for all (what else is new?)

We use ColdFusion so I created custom tags for both the TEXTAREA and the INPUT TYPE=&quot;TEXT&quot; so that the tag can detect what browser is being used and then display the field using an appropriate size which is passed as an attribute. Mitch Duszynski
Web Developer
Human Kinetics
PO Box 5076, Champaign, IL 61825
Tel: 217-351-5076 x2474 | Fax: 217-351-2674
mitchd@hkusa.com |
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top