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. Is anybody know how to validate(using javascript) a textbox inside datagrid

Is anybody know how to validate(using javascript) a textbox inside datagrid

Scheduled Pinned Locked Moved ASP.NET
javascripthelptutorial
5 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
    kpsetty
    wrote on last edited by
    #1

    hi friends, i don't know how to validate(using javascript) a textbox control inside a datagrid.please help me i am new to this.

    A 1 Reply Last reply
    0
    • K kpsetty

      hi friends, i don't know how to validate(using javascript) a textbox control inside a datagrid.please help me i am new to this.

      A Offline
      A Offline
      Al Ortega
      wrote on last edited by
      #2

      What kind of validation are you trying to do? I have used the asp.net controls for validation (required field, and compare) on textboxes within a grid to ensure a valid email was entered with no problem.

      K 1 Reply Last reply
      0
      • A Al Ortega

        What kind of validation are you trying to do? I have used the asp.net controls for validation (required field, and compare) on textboxes within a grid to ensure a valid email was entered with no problem.

        K Offline
        K Offline
        kpsetty
        wrote on last edited by
        #3

        i want to use javascript validation.The textbox(inside the datagrid) should not accept special characters like @#^&|\/%~`

        U 1 Reply Last reply
        0
        • K kpsetty

          i want to use javascript validation.The textbox(inside the datagrid) should not accept special characters like @#^&|\/%~`

          U Offline
          U Offline
          UnmeshDesale
          wrote on last edited by
          #4

          Hiii Dear, If ur using server side textbox control then u write following code in ItemDataBound event of the datagrid for binding ur javascript function to textbox. e.Item.Cells(0).Controls(1).Attributes("Onblur") = String.Format("ValidateText({0});", this.ClientID) This will call the ValidateText function for textboxe on which onblur event fires.In that function you can mention one RegExp object for the further validation. It will help you.:) Unmon

          K 1 Reply Last reply
          0
          • U UnmeshDesale

            Hiii Dear, If ur using server side textbox control then u write following code in ItemDataBound event of the datagrid for binding ur javascript function to textbox. e.Item.Cells(0).Controls(1).Attributes("Onblur") = String.Format("ValidateText({0});", this.ClientID) This will call the ValidateText function for textboxe on which onblur event fires.In that function you can mention one RegExp object for the further validation. It will help you.:) Unmon

            K Offline
            K Offline
            kpsetty
            wrote on last edited by
            #5

            hi dear, i can't get any intellisence after " e.Item.Cells(0).Controls(1).... ", i don't know how u get this. i tried in the itemdatabound and itemcommand

            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