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

  1. #1

    Default Re: Length validation?

    Hi, Wim!

    Easier to use for a developer. True.

    But not that advanced validation, for instance if you want to use the
    Validator controls functionality
    for displaying information about that it can't exceed the limit of 25 chars
    etc. This is mostly
    a better explanation to the user of the application.

    Regards
    /Emil


    "Wim Hollebrandse" <wimATwimdows.com> wrote in message
    news:u7hU$MtSDHA.3796@tk2msftngp13.phx.gbl...
    > Easier than using regular expressions - and more effective is by simply
    > setting the MaxLength property of the TextBox webcontrol.
    >
    > Cheers,
    > Wim Hollebrandse
    > [url]http://www.wimdows.com[/url]
    > [url]http://www.wimdows.net[/url]
    >
    > "George Ter-Saakov" <we@hotmail.com> wrote in message
    > news:uJA7q$sSDHA.2276@TK2MSFTNGP10.phx.gbl...
    > > What validator can validate the length of the text entered?
    > > I have an input box for First Name and it must not exceed 25 characters
    > > (limited in database).
    > > Which validator can do that?
    > >
    > > George
    > >
    > >
    >
    >

    Emil Kvarnhammar Guest

  2. Similar Questions and Discussions

    1. CFFORM Validation trumping Custom Form Validation
      Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two...
    2. copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome?
      I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed...
    3. How to get length of string? length() problems
      Simplified a bit, I'm parsing HTML documents to get sentences e.g. my $html = get($URL); # remove all HTML TAGs...blah blah blah @sentences =...
    4. validation summary doesnt display when there's client-side validation
      I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so...
    5. only custom validation control does server side validation?
      On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator...
  3. #2

    Default Re: Length validation?

    Hi

    If regular input <element maxlength="25"
    Textarea ( multiline)
    myInput.Attributes.Add("onkeydown","if(this.value. length > 25) return
    false");


    And of course server validation is a good thing to do also

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "George Ter-Saakov" <we@hotmail.com> wrote in message
    news:uJA7q$sSDHA.2276@TK2MSFTNGP10.phx.gbl...
    > What validator can validate the length of the text entered?
    > I have an input box for First Name and it must not exceed 25 characters
    > (limited in database).
    > Which validator can do that?
    >
    > George
    >
    >

    Vidar Petursson Guest

  4. #3

    Default Re: Length validation?

    Easier than using regular expressions - and more effective is by simply
    setting the MaxLength property of the TextBox webcontrol.

    Cheers,
    Wim Hollebrandse
    [url]http://www.wimdows.com[/url]
    [url]http://www.wimdows.net[/url]

    "George Ter-Saakov" <we@hotmail.com> wrote in message
    news:uJA7q$sSDHA.2276@TK2MSFTNGP10.phx.gbl...
    > What validator can validate the length of the text entered?
    > I have an input box for First Name and it must not exceed 25 characters
    > (limited in database).
    > Which validator can do that?
    >
    > George
    >
    >

    Wim Hollebrandse Guest

  5. #4

    Default Re: Length validation?

    Sure - in that case go for a RegularExpressionValidator control.

    As some of the other guys mentioned, a regex like ^.{,25}$ will do the
    trick.

    Cheers,
    Wim Hollebrandse
    [url]http://www.wimdows.com[/url]
    [url]http://www.wimdows.net[/url]

    "Emil Kvarnhammar" <emil@eqinox.com> wrote in message
    news:OC5joctSDHA.1688@TK2MSFTNGP11.phx.gbl...
    > Hi, Wim!
    >
    > Easier to use for a developer. True.
    >
    > But not that advanced validation, for instance if you want to use the
    > Validator controls functionality
    > for displaying information about that it can't exceed the limit of 25
    chars
    > etc. This is mostly
    > a better explanation to the user of the application.
    >
    > Regards
    > /Emil
    >
    >
    > "Wim Hollebrandse" <wimATwimdows.com> wrote in message
    > news:u7hU$MtSDHA.3796@tk2msftngp13.phx.gbl...
    > > Easier than using regular expressions - and more effective is by simply
    > > setting the MaxLength property of the TextBox webcontrol.
    > >
    > > Cheers,
    > > Wim Hollebrandse
    > > [url]http://www.wimdows.com[/url]
    > > [url]http://www.wimdows.net[/url]
    > >
    > > "George Ter-Saakov" <we@hotmail.com> wrote in message
    > > news:uJA7q$sSDHA.2276@TK2MSFTNGP10.phx.gbl...
    > > > What validator can validate the length of the text entered?
    > > > I have an input box for First Name and it must not exceed 25
    characters
    > > > (limited in database).
    > > > Which validator can do that?
    > > >
    > > > George
    > > >
    > > >
    > >
    > >
    >
    >

    Wim Hollebrandse 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