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. Custom Validator for validate string

Custom Validator for validate string

Scheduled Pinned Locked Moved ASP.NET
database
4 Posts 1 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.
  • Y Offline
    Y Offline
    ybasha
    wrote on last edited by
    #1

    Hi there, i want to validate user input in the text box which take a document number to check in database, the input must be in this format SSD-SGZZ99-A0101 or SSD-SGZZ99-AE0101 [(3alpha)(-)(4alpha 2numeric)(-)(1 or 2alpha 4numeric)] Total 16 or 17 character, now can some one send me a sample to validate this requirement.... i also want to disable the button till this validation is not completed, once the user keyin the right number the button should be enable. any suggestion will be appreciated. i need the sample code to use the custom validator control. Regards Ybasha

    Y 2 Replies Last reply
    0
    • Y ybasha

      Hi there, i want to validate user input in the text box which take a document number to check in database, the input must be in this format SSD-SGZZ99-A0101 or SSD-SGZZ99-AE0101 [(3alpha)(-)(4alpha 2numeric)(-)(1 or 2alpha 4numeric)] Total 16 or 17 character, now can some one send me a sample to validate this requirement.... i also want to disable the button till this validation is not completed, once the user keyin the right number the button should be enable. any suggestion will be appreciated. i need the sample code to use the custom validator control. Regards Ybasha

      Y Offline
      Y Offline
      ybasha
      wrote on last edited by
      #2

      i need the script to validate some thing like this function validateDate() { var ptext = document.getElementById("TBDocNum"); if(ptext = ("(SSD)|(SSA)(-)(a-zA-Z0-9){4,2}(-)(a-zA-Z0-9){6,2})"); } but it not correct any help on this???

      Y 1 Reply Last reply
      0
      • Y ybasha

        i need the script to validate some thing like this function validateDate() { var ptext = document.getElementById("TBDocNum"); if(ptext = ("(SSD)|(SSA)(-)(a-zA-Z0-9){4,2}(-)(a-zA-Z0-9){6,2})"); } but it not correct any help on this???

        Y Offline
        Y Offline
        ybasha
        wrote on last edited by
        #3

        or can some one give me a simple to break this string SSD-SGZZ99-A0101 --> 16 character or SSD-SGZZ99-AE0101 --> 17 character to added in ValidationExpression="(SSD)|(SSA)(-)(a-zA-Z0-9){4,2}(-)(a-zA-Z0-9){6,2})" for regular expression validator. regards Ybasha

        1 Reply Last reply
        0
        • Y ybasha

          Hi there, i want to validate user input in the text box which take a document number to check in database, the input must be in this format SSD-SGZZ99-A0101 or SSD-SGZZ99-AE0101 [(3alpha)(-)(4alpha 2numeric)(-)(1 or 2alpha 4numeric)] Total 16 or 17 character, now can some one send me a sample to validate this requirement.... i also want to disable the button till this validation is not completed, once the user keyin the right number the button should be enable. any suggestion will be appreciated. i need the sample code to use the custom validator control. Regards Ybasha

          Y Offline
          Y Offline
          ybasha
          wrote on last edited by
          #4

          Hi there, I already got the solution. regards ybasha

          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