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. Validation control issues...

Validation control issues...

Scheduled Pinned Locked Moved ASP.NET
helpcsharpvisual-studiocomregex
4 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.
  • K Offline
    K Offline
    kinsella_john
    wrote on last edited by
    #1

    i am using visual studio 2003 primarily i am experiencing difficulties with the range validator.. i am trying to create a range for a password field ! i have the max value set to 12 and the min set to 6 type = string this was generating an error at compile time. i read on another forum that this could be solved by switching the type to integer.. the code now compiles but generates an error regardless as to what is put in.


    also i was trying to validate a D.O.B field with a regular expression validator.. but my mind is blow here. im completely lost as, date doesnt seem to exist as a regular expression. any help much appreciated cheers

    John Michael Kinsella kinsellajohn@hotmail.com

    M S 2 Replies Last reply
    0
    • K kinsella_john

      i am using visual studio 2003 primarily i am experiencing difficulties with the range validator.. i am trying to create a range for a password field ! i have the max value set to 12 and the min set to 6 type = string this was generating an error at compile time. i read on another forum that this could be solved by switching the type to integer.. the code now compiles but generates an error regardless as to what is put in.


      also i was trying to validate a D.O.B field with a regular expression validator.. but my mind is blow here. im completely lost as, date doesnt seem to exist as a regular expression. any help much appreciated cheers

      John Michael Kinsella kinsellajohn@hotmail.com

      M Offline
      M Offline
      mareers
      wrote on last edited by
      #2

      (0[1-9]|1[0-2]|[1-9])/(0[1-9]|1[0-9]|2[0-9]|3[0-1]|[1-9])/\d{4})$ this is reg exp to validate a date.... mm/dd/yyyy format

      mareers

      1 Reply Last reply
      0
      • K kinsella_john

        i am using visual studio 2003 primarily i am experiencing difficulties with the range validator.. i am trying to create a range for a password field ! i have the max value set to 12 and the min set to 6 type = string this was generating an error at compile time. i read on another forum that this could be solved by switching the type to integer.. the code now compiles but generates an error regardless as to what is put in.


        also i was trying to validate a D.O.B field with a regular expression validator.. but my mind is blow here. im completely lost as, date doesnt seem to exist as a regular expression. any help much appreciated cheers

        John Michael Kinsella kinsellajohn@hotmail.com

        S Offline
        S Offline
        Sandeep Kumar
        wrote on last edited by
        #3

        Hi For your requirement try to use javascript insted of Range Validator as the Range Validator will not Check the Length.Range Validator checks the Value which u entered in the textbox with the Minimum value and MAximum value. In your case you are getting Compile time error because whenever type=string then it checks the ASCII values of the Min value and Max Value(Only first Characters) as you entered min value as 6(ASCII value is 54)which is greater than Max value 1(ASCII Value is 49) so it showing compile time error. So for your requirement you can write a Javascript function to validate that input length.

        K 1 Reply Last reply
        0
        • S Sandeep Kumar

          Hi For your requirement try to use javascript insted of Range Validator as the Range Validator will not Check the Length.Range Validator checks the Value which u entered in the textbox with the Minimum value and MAximum value. In your case you are getting Compile time error because whenever type=string then it checks the ASCII values of the Min value and Max Value(Only first Characters) as you entered min value as 6(ASCII value is 54)which is greater than Max value 1(ASCII Value is 49) so it showing compile time error. So for your requirement you can write a Javascript function to validate that input length.

          K Offline
          K Offline
          kinsella_john
          wrote on last edited by
          #4

          thank you for your suggestion, could you suggest the javascript that i could use as i dont actually have any experience with it.. just a snippet of code that forces a value of between 6 - 12 characters would be greatly appreciated..

          John Michael Kinsella kinsellajohn@hotmail.com

          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