Textbox width scaling to width of data not width of page?

Discussion in 'ASP .Net' started by AndrewF, Oct 10, 2005.

  1. AndrewF

    AndrewF Guest

    Hi there,

    I have racked my brains for days on this and can't seem to find a
    solution.

    I have a form which is dynamically creating some text boxes on it. The
    text boxes are single line ones.

    At the moment I am creating them and not specifying either width or
    column size, preferring to use CSS to style them so the designers can
    do it rather than digging through code.

    So we have set the fields to be 80% of the page width and it works
    absolutely fine when the text in the text fields are empty or less than
    80% of the page width.

    What happens when the text is longer than that though is that the page
    is created to be the width of the text that would be in the text field
    if it were all on one line and then the text field is scaled back to
    80% of that.

    So on particularly long entries it could double the screen width.
    Generally it would be a case of putting in a text box which is
    multiline but by and large it isn't necessary other than on a few odd
    entries where they are entering more text.

    Does anyone have any idea why this is happening?

    Cheers
    AndrewF
    AndrewF, Oct 10, 2005
    #1
    1. Advertising

  2. AndrewF

    Bruce Barker Guest

    you have to specify a page width, so that the 80% is a percent of something.
    currently the page is calc'ing the text width to get the page width, then
    scaling the textbox to 80% of that.

    -- bruce (sqlwork.com)


    "AndrewF" <> wrote in message
    news:...
    > Hi there,
    >
    > I have racked my brains for days on this and can't seem to find a
    > solution.
    >
    > I have a form which is dynamically creating some text boxes on it. The
    > text boxes are single line ones.
    >
    > At the moment I am creating them and not specifying either width or
    > column size, preferring to use CSS to style them so the designers can
    > do it rather than digging through code.
    >
    > So we have set the fields to be 80% of the page width and it works
    > absolutely fine when the text in the text fields are empty or less than
    > 80% of the page width.
    >
    > What happens when the text is longer than that though is that the page
    > is created to be the width of the text that would be in the text field
    > if it were all on one line and then the text field is scaled back to
    > 80% of that.
    >
    > So on particularly long entries it could double the screen width.
    > Generally it would be a case of putting in a text box which is
    > multiline but by and large it isn't necessary other than on a few odd
    > entries where they are entering more text.
    >
    > Does anyone have any idea why this is happening?
    >
    > Cheers
    > AndrewF
    >
    Bruce Barker, Oct 10, 2005
    #2
    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. =?Utf-8?B?REVXcmlnaHRfQ0E=?=

    Page & Control Scaling?

    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, May 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    364
    Steven Cheng[MSFT]
    May 26, 2005
  2. Replies:
    4
    Views:
    1,270
    Knute Johnson
    Dec 5, 2007
  3. FPGA

    Scaling data

    FPGA, Feb 3, 2008, in forum: VHDL
    Replies:
    2
    Views:
    474
    sudhi
    Feb 3, 2008
  4. CBlair1986
    Replies:
    0
    Views:
    109
    CBlair1986
    Apr 23, 2006
  5. Steve
    Replies:
    4
    Views:
    208
    Steve
    Feb 7, 2006
Loading...

Share This Page