Solved

INPUT Tags: MSIE vs NN

Posted on 2000-03-11
7
221 Views
Last Modified: 2010-04-09
My input tags look fine in NN but in MSIE they are considerably shorter and it's a real pain. Is there any way to force MSIE to display INPUT tag lengths in the same way as NN does?
0
Comment
Question by:lhutton
7 Comments
 
LVL 2

Expert Comment

by:HolySpirit
ID: 2609017
lhutton,
You can try this script to make the input box longer :
<input type = text name = myTextBox style = "width : 100">

and this code will make a 100 pixel width text box in IE
-- Holy Spirit
0
 
LVL 1

Expert Comment

by:chaduka
ID: 2609348
or you can try this:
<input type="text" name="myTextBox" size="100">
...this should achieve the same effect as Holy Spirit's suggestion.
0
 
LVL 1

Expert Comment

by:aut
ID: 2609494
HolySpirit's suggestion is different from chaduka's suggestion. The former specifies the exact size in pixels.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:lhutton
ID: 2610565
Explanations, please! I've just discovered some things I wasn't aware of...

It seems that without a size (or style) attribute, NN automatically makes the width of my input tag the width of the table cell. Is it supposed to do that? When I use a style tag, IE takes notice but NN still makes it the width of the table cell, whether the width is set to 2 or 2000!!

This is really bizarre. I would love to hear from someone, some explanations as to what's happening here :)
0
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 2612925
<input type="text" name="myTextBox" &{"size=4"}; size="4">
0
 
LVL 7

Accepted Solution

by:
nettrom earned 25 total points
ID: 2615278
size="100" and style="width:100px" aren't equivalent since the input is of type "text", see http://www.w3.org/TR/REC-html40/interact/forms.html#adef-size-INPUT

Netscape will ignore the style setting since it's not good at applying style properties to form elements.

I'd say that it's impossible to get the input field to be the exact same size in both IE and Netscape.  create it with a size that fits (in other words, set it to be the default number of characters you'd like), and then see how it works out.  if IE sizes it incorrectly, try applying a width using the style attribute.  using values relative to the font size of the user might be what you're looking for, e.g:

<input type="text" name="test" size="40" style="width;40em;">

for more information regarding style & CSS, see http://www.w3.org/Style/CSS/ or the CSS2 spec http://www.w3.org/TR/REC-CSS2/ (the part where values is defined is http://www.w3.org/TR/REC-CSS2/syndata.html#values )
0
 

Author Comment

by:lhutton
ID: 2616213
Thanks nettrom. That explains things better :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now