Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to validate input?

How to validate input?

Scheduled Pinned Locked Moved ASP.NET
questiontutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Ming Luo
    wrote on last edited by
    #1

    Hi all: I need a textbox which can only be inputed a 6 digit number. How can I do that please? Thanks in advance!!! Asura

    D G 2 Replies Last reply
    0
    • M Ming Luo

      Hi all: I need a textbox which can only be inputed a 6 digit number. How can I do that please? Thanks in advance!!! Asura

      D Offline
      D Offline
      Dinuj Nath
      wrote on last edited by
      #2

      Use regular expression validation control. http://samples.gotdotnet.com/quickstart/aspplus/doc/webvalidation.aspx[^] http://aspnet101.com/aspnet101/tutorials.aspx?id=11[^]

      1 Reply Last reply
      0
      • M Ming Luo

        Hi all: I need a textbox which can only be inputed a 6 digit number. How can I do that please? Thanks in advance!!! Asura

        G Offline
        G Offline
        gyokusei
        wrote on last edited by
        #3

        1. set MaxLength property of that textbox to 6 2. drag a RegularExpressionValidator to .aspx page 3. set ControlToValidate property to the id of that textbox. 4. enter an expression to ValidationExpression property like this: (\d){6}

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups