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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Boxes the same width in Netscape and IE 2

Status
Not open for further replies.

Nsynan

Programmer
Jul 30, 2001
18
0
0
US
Somewhere I've seen a javascript to apply to the following type form to keep the text box widths the same in appearance for Netscape and IE.

Example:

<form name=&quot;inputform&quot; action=&quot;processform.asp&quot;>
<input type=&quot;text&quot; name=&quot;code1&quot; size=&quot;1&quot; maxlength=&quot;1&quot;></font>
<input type=&quot;text&quot; name=&quot;code2&quot; size=&quot;2&quot; maxlength=&quot;2&quot;></font>
<input type=&quot;text&quot; name=&quot;code3&quot; size=&quot;1&quot; maxlength=&quot;1&quot;></font>
<input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;submitnumbers&quot;>
</form>

The widths of the above text boxes appear very different in Netscape and IE.

Thanks
Nathan Synan
 
Hi Nathan,

This should help you, for size 3 or above, you can just play around with the width.

<html>
<head>
<style>
input.text.textbox1 {width:17}
input.text.textbox2 {width:25}
</style>
</head>

<body>
<form name=&quot;inputform&quot; action=&quot;processform.asp&quot;>
<input type=&quot;text&quot; name=&quot;code1&quot; size=&quot;1&quot; maxlength=&quot;1&quot; class=&quot;textbox1&quot;>
<input type=&quot;text&quot; name=&quot;code2&quot; size=&quot;2&quot; maxlength=&quot;2&quot; class=&quot;textbox2&quot;>
<input type=&quot;text&quot; name=&quot;code3&quot; size=&quot;1&quot; maxlength=&quot;1&quot; class=&quot;textbox1&quot;>
</form>
</body>
</html>

hope this helps,

Chiu Chan
WebMaster & Software Engineer
emagine solutions, inc
cchan@emagine-solutions.com
 
Thanks guys for all your help and the info. Forums like this are great and the response time can not be beat!!!

However, I did finally find the javascript I was looking for and I'll post the link to the site where you can find it. This should help all those have created HTML forms that look pretty in one browser, but when you go to check it out in the other, you find it UGLY!!

Here's the site:


Thanks again guys,
Nathan Synan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top