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

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
 
P

Patrice

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
 
B

bruce barker

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)
 
M

Madhanmohan S

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

Thanks and Regards
Madhanmohan S
 
P

Patrice

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

--
 
M

Madhanmohan S

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top