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 date validation

how to date validation

Scheduled Pinned Locked Moved ASP.NET
helptutorial
8 Posts 5 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.
  • B Offline
    B Offline
    ballameharmurali
    wrote on last edited by
    #1

    hello everyone, I have small doubt regarding DateValidation.I have a textbox and button in a webform.aspx page .When i enter a date and click on button the corresponding date validations should be done and dateformat should be in dd/mm/yyyy format only.Plz help in write it is very urgent for me,... ok byeee Murali Murali

    S N S I 4 Replies Last reply
    0
    • B ballameharmurali

      hello everyone, I have small doubt regarding DateValidation.I have a textbox and button in a webform.aspx page .When i enter a date and click on button the corresponding date validations should be done and dateformat should be in dd/mm/yyyy format only.Plz help in write it is very urgent for me,... ok byeee Murali Murali

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Javascript

      SSK.

      1 Reply Last reply
      0
      • B ballameharmurali

        hello everyone, I have small doubt regarding DateValidation.I have a textbox and button in a webform.aspx page .When i enter a date and click on button the corresponding date validations should be done and dateformat should be in dd/mm/yyyy format only.Plz help in write it is very urgent for me,... ok byeee Murali Murali

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        ballameharmurali wrote:

        dateformat should be in dd/mm/yyyy

        You can use this regular expression to validate this \b[0-9]{2}/[0-9]{2}/[0-9]{4}\b


        My Website | Ask smart questions

        S 1 Reply Last reply
        0
        • N N a v a n e e t h

          ballameharmurali wrote:

          dateformat should be in dd/mm/yyyy

          You can use this regular expression to validate this \b[0-9]{2}/[0-9]{2}/[0-9]{4}\b


          My Website | Ask smart questions

          S Offline
          S Offline
          Sathesh Sakthivel
          wrote on last edited by
          #4

          he asked for Javascript not the Regular expression.

          SSK.

          N 1 Reply Last reply
          0
          • B ballameharmurali

            hello everyone, I have small doubt regarding DateValidation.I have a textbox and button in a webform.aspx page .When i enter a date and click on button the corresponding date validations should be done and dateformat should be in dd/mm/yyyy format only.Plz help in write it is very urgent for me,... ok byeee Murali Murali

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

            Try this code.... i hope it helps VB. If IsDate(Text1.Text) then Text1.Text = Format(Text1.text, "dd/mm/yyyy") Else MsgBox ("Wrong Date"), vbCritical Text1.SetFocus End If

            1 Reply Last reply
            0
            • S Sathesh Sakthivel

              he asked for Javascript not the Regular expression.

              SSK.

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              Vri SSK wrote:

              he asked for Javascript not the Regular expression.

              Is it., After getting regular expression, still he don't know how to integrate that with javascript,. it's shame on him. He can integrate this expression with javascript and that will give the result what he expected.


              My Website | Ask smart questions

              S 1 Reply Last reply
              0
              • N N a v a n e e t h

                Vri SSK wrote:

                he asked for Javascript not the Regular expression.

                Is it., After getting regular expression, still he don't know how to integrate that with javascript,. it's shame on him. He can integrate this expression with javascript and that will give the result what he expected.


                My Website | Ask smart questions

                S Offline
                S Offline
                Sathesh Sakthivel
                wrote on last edited by
                #7

                Let him try, we have helped him in all aspects.still no reply from him.

                SSK.

                1 Reply Last reply
                0
                • B ballameharmurali

                  hello everyone, I have small doubt regarding DateValidation.I have a textbox and button in a webform.aspx page .When i enter a date and click on button the corresponding date validations should be done and dateformat should be in dd/mm/yyyy format only.Plz help in write it is very urgent for me,... ok byeee Murali Murali

                  I Offline
                  I Offline
                  Imran Khan Pathan
                  wrote on last edited by
                  #8

                  HI murali U can do that easily by using compareValidator. Set belove property of compareValidator. Type="Date" ValueToCompare="01/01/1901" ControlToValidate="TextBox1" ErrorMessage="Enter valid date" SetFocusOnError="True" Operator="GreaterThanEqual" Best Regard Pathan

                  GOD HELP THOSE WHO HELP THEMSELVES

                  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