Is this an MS bug..?

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Is this an MS bug..?

    I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
    from entering more than maxlength either by not allowing you to input more
    chars or removing text to the end beginning at max length... If I change
    mode to multiline I'm able to put as much text as I like regardless of the
    maxlength I specify...

    Is this a bug...?


    alien2_51 Guest

  2. #2

    Default Re: Is this an MS bug..?

    no....<asp:textbox TextMode="Multiline".../> gets rendered as an html
    <textarea></textarea> which, unline the html <input type="text".../> does
    not support a maxlength property. There are ways, using Javascript to limit
    the length however.

    as such, it's a limitation of HTML...which all webcontrols must map to.

    Karl

    "alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
    news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...
    > I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
    > from entering more than maxlength either by not allowing you to input more
    > chars or removing text to the end beginning at max length... If I change
    > mode to multiline I'm able to put as much text as I like regardless of the
    > maxlength I specify...
    >
    > Is this a bug...?
    >
    >

    Karl Seguin Guest

  3. #3

    Default Re: Is this an MS bug..?

    No, it's just a limitation of HTML. A multi-line textbox is implemented as a
    textarea, which has no maxlength property. You'll have to validate the input
    yourself using a RegularExpressionValidator or some other means.

    Calvin

    "alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
    news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...
    > I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
    > from entering more than maxlength either by not allowing you to input more
    > chars or removing text to the end beginning at max length... If I change
    > mode to multiline I'm able to put as much text as I like regardless of the
    > maxlength I specify...
    >
    > Is this a bug...?
    >
    >

    Calvin Bottoms Guest

  4. #4

    Default Re: Is this an MS bug..?

    Thanks.... makes very much sense....


    "alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
    news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...
    > I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
    > from entering more than maxlength either by not allowing you to input more
    > chars or removing text to the end beginning at max length... If I change
    > mode to multiline I'm able to put as much text as I like regardless of the
    > maxlength I specify...
    >
    > Is this a bug...?
    >
    >

    alien2_51 Guest

  5. #5

    Default Re: Is this an MS bug..?

    Hi

    What about ( Does not work on all browsers.... better check onsubmit/Server
    also.)

    myTextArea.Attributes.Add("onkeydown","if(this.val ue.length >=255) return
    false");

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "alien2_51" <dan.billow@n.o.s.p.a.m.monacocoach.com> wrote in message
    news:OmLg4BYQDHA.2432@TK2MSFTNGP10.phx.gbl...
    > I have a ASP.Net TextBox in singleline mode, maxlength prevents the user
    > from entering more than maxlength either by not allowing you to input more
    > chars or removing text to the end beginning at max length... If I change
    > mode to multiline I'm able to put as much text as I like regardless of the
    > maxlength I specify...
    >
    > Is this a bug...?
    >
    >

    Vidar Petursson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139