Thanks Spunkey!! When I tried the above code, it reduced the width of the second box too.
For now, I did this:
<HTML>
<input style="width: 20px" type="text" name="text1" value = "W" maxlength = "1" size = "1" class=mybox >
<input type="text" name="text2" value = "WWWWW" maxlength = "5" size="5" class=mybox >
</HTML>
This works for the example, in my real application we have hundreds of such boxes.. so I welcome and appreciate all ideas.
Thanks
Main Topics
Browse All Topics





by: SpunkeyPosted on 2004-05-20 at 09:38:53ID: 11118980
im afraid all you can do is set the width of the box to the smallest value you can, with the largest width character still visible. In this case, as you had done, the widest char is W. Therefore the code below will sort you out.
Although, as soon as someone puts an 'I' in the works you're going to have the same problem.
<HTML>
<style>
.mybox {width: 20px}
</style>
<input type="text" name="text1" value = "W" maxlength = "1" size = "1" class=mybox >
<input type="text" name="text2" value = "WWWWW" maxlength = "5" size="5" class=mybox >
</HTML>
my suggestion would be to use a <select> box and list all available options in that.
Cheers