Forum Moderators: open

Message Too Old, No Replies

TextBox Size bug

         

Yoeri

1:03 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



Have the following annoying bug ... anybody a solution?

The problem:
------------
In our wabapp, we have a form with a typical table layout. The whole app is scalable, so I worked in percentages. I also limit the use of tables (this is the only one).
But ... when setting the width of a textbox to a percentage, I encounter a bug in IE. Seems that the textbox grows when tere is lots of text in it ...

Here is the HTML:
-----------------
<html>
<head>
<title></title>
<style>
INPUT { width: 50%; }
DIV.table {width: 100%; }
</style>
</head>
<body>
<form>
<div class="table">
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td><label for="Long">Long string</label>
</td><td>
<input id="Long" name="Long" type="text" value="Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string Een lange string">
</td></tr>
<tr><td><label for="Short">Short string</label>
</td><td>
<input name="Short" id="Short" type="text" value="Een korte string">
</td></tr>
</table>
</div>
</form>
</body>
</html>

Thanks in advance ...

Yoeri

korkus2000

5:26 pm on Jun 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried styling the td tags to set a maximum width for the cell?

Yoeri

1:13 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Nope, tried setting a width on the TD, also tried to wrap the input field in a DIV with a width on it ... but it won't give me the expected result ...

SuzyUK

2:27 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yoeri.. will the long value be being sent (hidden?) by the "value" attribute.. or is that there for testing?

Will it be being typed in by the user?

The reason I ask is that the extended width seems to be being caused by the "value attribute" if you cut that long string and then paste it into the textbox, the problem doesn't occur?

Suzy

korkus2000

2:35 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since this is a web app I would make sure everyone had javascript turned on and populate the textbox.value with the long string.

Yoeri

8:51 am on Jun 8, 2003 (gmt 0)

10+ Year Member



It is in an ASP.NET application.

The user types in a long string which is no problem.

When submitting, the values of the textboxes are validated on the server, and sent back to the client when there are errors.
On that moment, the values are again filled in in the boxes, and the layout is bad ... as stated in the problem...

I also have it in Master-detail views .... so I cannot do it otherwise ...

korkus2000

1:45 pm on Jun 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So is it an asp textbox or a datagrid with template columns?

Yoeri

7:59 pm on Jun 8, 2003 (gmt 0)

10+ Year Member



neither one, we created an MVC framework for our ASP.net web apps.

We create an xml model and transform it to XHTML using XSLT, so we don't use the asp.net controls...

Yoeri

8:38 am on Jun 23, 2003 (gmt 0)

10+ Year Member



Solved, indeed with using javascript to set the values of the textboxes.

I don't like this solution, it is kinda dirty, but it works ...