input type=text size parameter

liunx

Guest
I have an input field defined as <input type="text" SIZE="3" Maxlength="6" NAME="Loc1">. However, under IE5.5 it actually shows a box big enough for 5 numbers. If I change size to 1, the input box is 3 number size. Is there some minimum size to the input box that the "size" in the html is added to to get the final size? thanks, Bostonrose<!--content-->what do you mean??? liket he field do not take input ledd then 3 chars??<!--content-->No, I just want the input box to be the size that fits the number of letters/numbers I need to put in it and thought the "size" would limit it and it doesn't. It's not a big problem, just wanted to understand the why's. Bostonrose.<!--content-->oh okkay..Its have a hack for this I alwasy use,,,<br />
Use CSS property width and use pixels fro the size..<br />
<br />
8 pixels is roughly = 1 characeter<br />
<br />
so if you want your text field to be as wide as for 6 character length this what it should look like<br />
<br />
<input type="text" Maxlength="6" name="Loc1" style="width:48px;"><br />
<br />
This should bring you close to what you want....:D <br />
<br />
And BTW try not using caps in attribute names it will cause problems in near future in browsers...<!--content-->Originally posted by khalidali63 <br />
<input type="text" Maxlength="6" name="Loc1" style="width:48px;"><br />
<br />
And BTW try not using caps in attribute names it will cause problems in near future in browsers... <br />
<br />
I beg to differ on both counts. Forms are not HTML level but system level controls. So the behavior will differ from system to system. If you want a pixel-perfect layout based on other stuff on your page, this may be a way to go. If you want it for some other reason, its best to leave it to the browser.<br />
<br />
I don't know about the future, but browsers will not stop supporting valid HTML 4.01 in a hurry. small attributes and elements are required only in XHTML. Since XHTML is the future of the web -or so it seems- its a good idea to make it a habit of using small case. But its not required.<!--content-->Thanks all for the info, I don't usually use caps for either, I'd just been playing with them, and accidentally the caps lock was on when I created it for sending here. Bostonrose.<!--content-->Originally posted by nkaisare <br />
......its a good idea to make it a habit of using small case. But its not required. <br />
<br />
Did I say anywhere that its required,I only mentioned it has potential of causing problems in future.<br />
<br />
Sure difference is good,but its always better if a post does contain some additions or a new solution to the underlying problem...( and your post contains neither)<!--content-->
 
Back
Top