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

Discussion in 'ASP .Net' started by Madhanmohan S, Sep 1, 2004.

  1. 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
    Madhanmohan S, Sep 1, 2004
    #1
    1. Advertising

  2. Madhanmohan S

    Patrice Guest

    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

    --

    "Madhanmohan S" <> a écrit dans le message de
    news:%...
    > 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
    >
    >
    Patrice, Sep 1, 2004
    #2
    1. Advertising

  3. Madhanmohan S

    bruce barker Guest

    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)


    "Madhanmohan S" <> wrote in message
    news:...
    > Hi Patrice,
    > The width of the textbox is depend on the width of the cell in

    which
    > it is contained. I have created a small page similar to our requirement.
    > Please run this page in you machine. Just click the submit button. You

    will
    > notice the behaviour.
    >
    > Thanks And Regards
    > Madhanmohan S
    >
    > "Patrice" <> wrote in message
    > news:...
    > > 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
    > >
    > > --
    > >
    > > "Madhanmohan S" <> a écrit dans le message de
    > > news:%...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
    >
    bruce barker, Sep 1, 2004
    #3
  4. Hi bruce,
    I got your point. Can you send me some code snippets for
    calculating the size in css?

    Thanks and Regards
    Madhanmohan S

    "bruce barker" <> wrote in message
    news:...
    > 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)
    >
    >
    > "Madhanmohan S" <> wrote in message
    > news:...
    > > Hi Patrice,
    > > The width of the textbox is depend on the width of the cell in

    > which
    > > it is contained. I have created a small page similar to our requirement.
    > > Please run this page in you machine. Just click the submit button. You

    > will
    > > notice the behaviour.
    > >
    > > Thanks And Regards
    > > Madhanmohan S
    > >
    > > "Patrice" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > > --
    > > >
    > > > "Madhanmohan S" <> a écrit dans le message de
    > > > news:%...
    > > > > 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
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >
    > >

    >
    >
    Madhanmohan S, Sep 2, 2004
    #4
  5. Madhanmohan S

    Patrice Guest

    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

    --

    "Madhanmohan S" <> a écrit dans le message de
    news:...
    > Hi bruce,
    > I got your point. Can you send me some code snippets for
    > calculating the size in css?
    >
    > Thanks and Regards
    > Madhanmohan S
    >
    > "bruce barker" <> wrote in message
    > news:...
    > > 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)
    > >
    > >
    > > "Madhanmohan S" <> wrote in message
    > > news:...
    > > > Hi Patrice,
    > > > The width of the textbox is depend on the width of the cell in

    > > which
    > > > it is contained. I have created a small page similar to our

    requirement.
    > > > Please run this page in you machine. Just click the submit button. You

    > > will
    > > > notice the behaviour.
    > > >
    > > > Thanks And Regards
    > > > Madhanmohan S
    > > >
    > > > "Patrice" <> wrote in message
    > > > news:...
    > > > > 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
    > > > >
    > > > > --
    > > > >
    > > > > "Madhanmohan S" <> a écrit dans le message de
    > > > > news:%...
    > > > > > 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
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Patrice, Sep 2, 2004
    #5
  6. Thanks, Patrice

    "Patrice" <> wrote in message
    news:%23Jsaf%...
    > 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
    >
    > --
    >
    > "Madhanmohan S" <> a écrit dans le message de
    > news:...
    > > Hi bruce,
    > > I got your point. Can you send me some code snippets for
    > > calculating the size in css?
    > >
    > > Thanks and Regards
    > > Madhanmohan S
    > >
    > > "bruce barker" <> wrote in message
    > > news:...
    > > > 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)
    > > >
    > > >
    > > > "Madhanmohan S" <> wrote in message
    > > > news:...
    > > > > Hi Patrice,
    > > > > The width of the textbox is depend on the width of the cell

    in
    > > > which
    > > > > it is contained. I have created a small page similar to our

    > requirement.
    > > > > Please run this page in you machine. Just click the submit button.

    You
    > > > will
    > > > > notice the behaviour.
    > > > >
    > > > > Thanks And Regards
    > > > > Madhanmohan S
    > > > >
    > > > > "Patrice" <> wrote in message
    > > > > news:...
    > > > > > 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
    > > > > >
    > > > > > --
    > > > > >
    > > > > > "Madhanmohan S" <> a écrit dans le message de
    > > > > > news:%...
    > > > > > > 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
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Madhanmohan S, Sep 3, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. volts
    Replies:
    0
    Views:
    496
    volts
    Apr 7, 2004
  2. Gnarlodious
    Replies:
    4
    Views:
    17,576
    elizas
    May 5, 2010
  3. lvirden
    Replies:
    10
    Views:
    563
    lvirden
    Jul 30, 2007
  4. Steven D'Aprano
    Replies:
    0
    Views:
    90
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    80
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page