Dynamic Size for Text Box - Expanding more than the relative size

  • Thread starter Thread starter Madhanmohan S
  • Start date Start date
M

Madhanmohan S

Hi All,
I am having a server TextBox control in my page. Size of the
TextBox is relative(i.e. 50%).When i view this page in IE, I observed a
behaviour which looks odd to me. If the size of the Text in the TextBox
increases then the size of he text Box also increases. If the size of the
text is very small then the TextBox is not increasing in length and it is
exactly 50%.
Can any one please help me in avoiding this specific problem?

Thanks and Regards
Madhanmohan S
 
IMO your best best is to have a look at the resulting HTML code to see how
exactly the size is defined. It's likley it depends from somthing else whose
size can itself vary ?


Patrice
 
you can not use % widths in this senerio. they are only suggestions to the
browser. the width of a td will expand to hold its content. so because the
textbox can get as much space as need from its parent, it does not have to
restrict its size. to fix the size you will have to set the absolute size.
you could calc in the style.

-- bruce (sqlwork.com)
 
Hi bruce,
I got your point. Can you send me some code snippets for
calculating the size in css?

Thanks and Regards
Madhanmohan S
 
Just use style="width:50%" or perhaps a class name.

As a side note my personal preference ois to use a fxided size for input so
that the user have an immediate clue about the allowed length...

Patrice

--
 
Thanks, Patrice

Patrice said:
Just use style="width:50%" or perhaps a class name.

As a side note my personal preference ois to use a fxided size for input so
that the user have an immediate clue about the allowed length...

Patrice
 
Back
Top