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. Javascript validation in asp.net for a textbox and dropdown

Javascript validation in asp.net for a textbox and dropdown

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-net
9 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.
  • R Offline
    R Offline
    rummer
    wrote on last edited by
    #1

    plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks

    V C A A 4 Replies Last reply
    0
    • R rummer

      plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      hey go to Google

      Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      1 Reply Last reply
      0
      • R rummer

        plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Well, if you want to hire someone to do your job for you, the job board is just over there. On the other hand, if you intend on being a programmer yourself, you should look up regular expression validators in that book that you surely bought to help you learn ASP.NET.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        1 Reply Last reply
        0
        • R rummer

          plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          use onblur="javascript: return reqcheck()" id="txt"

          function reqcheck()
          {
          var txt = document.getElementById('txt');
          if(txt.value.length == 0) return false;
          return true;
          }

          :rose:

          Abhishek Sur


          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

          **Don't forget to click "Good Answer" if you like to.

          C 1 Reply Last reply
          0
          • A Abhishek Sur

            use onblur="javascript: return reqcheck()" id="txt"

            function reqcheck()
            {
            var txt = document.getElementById('txt');
            if(txt.value.length == 0) return false;
            return true;
            }

            :rose:

            Abhishek Sur


            My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

            **Don't forget to click "Good Answer" if you like to.

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Um, this will return true or false for one of the cases he mentioned, but how will it perform validation ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            A 1 Reply Last reply
            0
            • C Christian Graus

              Um, this will return true or false for one of the cases he mentioned, but how will it perform validation ?

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              A Offline
              A Offline
              Abhishek Sur
              wrote on last edited by
              #6

              I dont know why those people dont use RequiredFieldValidators or RegularExpressionValidators for this.... I think those checks both in server as well as client.. :-D :-D Anyway, he can trap others in form onsubmit="javascript: return validatefunction();" I guess. I thought he can do the others himself. ;P ;P :rose:

              Abhishek Sur


              My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

              **Don't forget to click "Good Answer" if you like to.

              C 1 Reply Last reply
              0
              • A Abhishek Sur

                I dont know why those people dont use RequiredFieldValidators or RegularExpressionValidators for this.... I think those checks both in server as well as client.. :-D :-D Anyway, he can trap others in form onsubmit="javascript: return validatefunction();" I guess. I thought he can do the others himself. ;P ;P :rose:

                Abhishek Sur


                My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                **Don't forget to click "Good Answer" if you like to.

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                Abhishek Sur wrote:

                I thought he can do the others himself.

                *grin* if he were capable of that, he'd be capable of working out what a regularexpressionvalidator was.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                A 1 Reply Last reply
                0
                • C Christian Graus

                  Abhishek Sur wrote:

                  I thought he can do the others himself.

                  *grin* if he were capable of that, he'd be capable of working out what a regularexpressionvalidator was.

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  A Offline
                  A Offline
                  Abhishek Sur
                  wrote on last edited by
                  #8

                  :laugh: Yes you are right. ;P

                  Abhishek Sur


                  My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                  **Don't forget to click "Good Answer" if you like to.

                  1 Reply Last reply
                  0
                  • R rummer

                    plz tell me javascript validation for a textbox for blank and only characters and for only numbers. and tell me how we use this function in textbox event. thanks

                    A Offline
                    A Offline
                    Arun Jacob
                    wrote on last edited by
                    #9

                    MSDN is a primary resource for this type of doubts, Have a look at Validator Controls. :)

                    Arun Jacob http://codepronet.blogspot.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