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 can i check textbox null in grid view using javascript

How can i check textbox null in grid view using javascript

Scheduled Pinned Locked Moved ASP.NET
helpjavascriptcssdatabasetools
6 Posts 4 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.
  • D Offline
    D Offline
    deepthy p m 0
    wrote on last edited by
    #1

    I am using ajax script manager and update panel in my form .In that i placed a gridview .Grid view values are filled from database .And i add two button in that grid view to enter quantity and rate.I want to chect that text boxes null when i submit that form to database.How can i do that.If any one understand my problem pls give code. i used the following code to check textbox null or not but it display javascript error. function valform() { var theGridView = document.getElementById('<%=grdProdReqDetails %>'); for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ ) { var theGridViewRemarks = theGridView.rows(rowCount).cells(4).children(0); if ( theGridViewRemarks.value.replace(/\s/g,"")== "") { alert("Please enter Current Requirement"); theGridViewRemarks.value =""; theGridViewRemarks.focus(); event.returnValue = false; return; } }

    W 1 Reply Last reply
    0
    • D deepthy p m 0

      I am using ajax script manager and update panel in my form .In that i placed a gridview .Grid view values are filled from database .And i add two button in that grid view to enter quantity and rate.I want to chect that text boxes null when i submit that form to database.How can i do that.If any one understand my problem pls give code. i used the following code to check textbox null or not but it display javascript error. function valform() { var theGridView = document.getElementById('<%=grdProdReqDetails %>'); for ( var rowCount = 1; rowCount < theGridView.rows.length; rowCount++ ) { var theGridViewRemarks = theGridView.rows(rowCount).cells(4).children(0); if ( theGridViewRemarks.value.replace(/\s/g,"")== "") { alert("Please enter Current Requirement"); theGridViewRemarks.value =""; theGridViewRemarks.focus(); event.returnValue = false; return; } }

      W Offline
      W Offline
      www Developerof NET
      wrote on last edited by
      #2

      May be this can help u... function CHKSelectAtleastOne(gridName) { var pointer=0; all=document.getElementsByTagName("input"); for(i=0;i<all.length;i++)> { if(all[i].type=="text")/*Checking if it is a textbox */ { if(all[i].value!="") pointer=1; } } if(pointer==0) { alert("Please select atleast one item"); return false; } else return true } and call this script on ur button click event Hope it helps...

      When you fail to plan, you are planning to fail.

      D 1 Reply Last reply
      0
      • W www Developerof NET

        May be this can help u... function CHKSelectAtleastOne(gridName) { var pointer=0; all=document.getElementsByTagName("input"); for(i=0;i<all.length;i++)> { if(all[i].type=="text")/*Checking if it is a textbox */ { if(all[i].value!="") pointer=1; } } if(pointer==0) { alert("Please select atleast one item"); return false; } else return true } and call this script on ur button click event Hope it helps...

        When you fail to plan, you are planning to fail.

        D Offline
        D Offline
        deepthy p m 0
        wrote on last edited by
        #3

        I think u cant understand my problem.

        W 1 Reply Last reply
        0
        • D deepthy p m 0

          I think u cant understand my problem.

          W Offline
          W Offline
          www Developerof NET
          wrote on last edited by
          #4

          deepthy.p.m wrote:

          I think u cant understand my problem.

          well i managed to extract what i understood. Please be clear. What do u want???

          When you fail to plan, you are planning to fail.

          B 1 Reply Last reply
          0
          • W www Developerof NET

            deepthy.p.m wrote:

            I think u cant understand my problem.

            well i managed to extract what i understood. Please be clear. What do u want???

            When you fail to plan, you are planning to fail.

            B Offline
            B Offline
            bommareddy200
            wrote on last edited by
            #5

            Hi Do u have any java script wich converts English to French Thanks Siva

            S 1 Reply Last reply
            0
            • B bommareddy200

              Hi Do u have any java script wich converts English to French Thanks Siva

              S Offline
              S Offline
              Sherin Iranimose
              wrote on last edited by
              #6

              ROTFL I cannot stop it...

              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