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. Regular Expression needed...

Regular Expression needed...

Scheduled Pinned Locked Moved ASP.NET
regex
6 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.
  • J Offline
    J Offline
    just3ala2
    wrote on last edited by
    #1

    Dear All I want to creat a regular expression for a dropdown list My first item in the dropdown list is "Please Select One..." So i want to create a regular expression to validate this i mean, i don't want to keep the dropdownlist with it's default selected value, i want to force the user to select one item And if there is a better solution for that, please tell me about it :D Thanx in advance

    Best Regards 3ala2 :)

    S S 2 Replies Last reply
    0
    • J just3ala2

      Dear All I want to creat a regular expression for a dropdown list My first item in the dropdown list is "Please Select One..." So i want to create a regular expression to validate this i mean, i don't want to keep the dropdownlist with it's default selected value, i want to force the user to select one item And if there is a better solution for that, please tell me about it :D Thanx in advance

      Best Regards 3ala2 :)

      S Offline
      S Offline
      smruti_ranjan
      wrote on last edited by
      #2

      Hi you have to use requiredfieldvalidator and set the property Initialvalue = "Please Select One..." Regards smruti Smruti

      1 Reply Last reply
      0
      • J just3ala2

        Dear All I want to creat a regular expression for a dropdown list My first item in the dropdown list is "Please Select One..." So i want to create a regular expression to validate this i mean, i don't want to keep the dropdownlist with it's default selected value, i want to force the user to select one item And if there is a better solution for that, please tell me about it :D Thanx in advance

        Best Regards 3ala2 :)

        S Offline
        S Offline
        samerh
        wrote on last edited by
        #3

        try this javascript and let me know.... function ValidateDegree(source,arguments) { if (document.Form1.DDLDegreeName.value == 0) { arguments.IsValid=false; return false; } else { arguments.IsValid=true; } }

        J 1 Reply Last reply
        0
        • S samerh

          try this javascript and let me know.... function ValidateDegree(source,arguments) { if (document.Form1.DDLDegreeName.value == 0) { arguments.IsValid=false; return false; } else { arguments.IsValid=true; } }

          J Offline
          J Offline
          just3ala2
          wrote on last edited by
          #4

          Thanx for the quick response :D Where to put this code?

          samerh wrote:

          ClientValidationFunction="ValidateDegree">

          and what event to call the previous one? and what if i had other valdators? would they still work fine? Thanx again

          Best Regards 3ala2 :)

          S 1 Reply Last reply
          0
          • J just3ala2

            Thanx for the quick response :D Where to put this code?

            samerh wrote:

            ClientValidationFunction="ValidateDegree">

            and what event to call the previous one? and what if i had other valdators? would they still work fine? Thanx again

            Best Regards 3ala2 :)

            S Offline
            S Offline
            samerh
            wrote on last edited by
            #5

            use custom validator with ClientValidationFunction="ValidateDegree". It will work. Man i need a favor on Any idea on how to encrypt password in web.config?

            J 1 Reply Last reply
            0
            • S samerh

              use custom validator with ClientValidationFunction="ValidateDegree". It will work. Man i need a favor on Any idea on how to encrypt password in web.config?

              J Offline
              J Offline
              just3ala2
              wrote on last edited by
              #6

              :D I don't wanna use the custom validator beacause it soes a postback, anyway, here r some links for ur issue http://mishler.net/2006/04/18/AspNet+Membership+Password+Administration.aspx[^] http://weblogs.asp.net/pleloup/archive/2003/07/04/9701.aspx[^] Hope this would help

              Best Regards 3ala2 :)

              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