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

Forms

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have created forms with text boxes within a difined table size. This form then opens in a javascript window. When i view the form in NS6 it displays wider than it should. In IE6 it displays ok. Can you tell me how to change the HTML to display the forms the same size in both browsers.

Thanks
 
IE and Netscape display the width of text boxes differently, so check beforehand:
Code:
if(document.all) {
   var textWidth = 20; // IE 
   }
else {
   var textWidth = 15; // Netscape
   }
Then you can use those variables in your HTML. Better yet, use this to load a stylesheet based on the browser. Hope that helps!
 
Another way would be to use size and style. Style will override size attribute for IE and NS6 while NS4 will ignore style.

<input type=&quot;text&quot; size=&quot;15&quot; style=&quot;width:100px;&quot;>

Tom
 
yo,

one more efficient way to do this is to use a browser detect which will toss the size into the form fields depending on what browser the user is, uh, using.

call me if you want help with the code on this:
phentalmyst@bluelucy.net

-pm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top