Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 6th, 2007, 03:08 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need to get value of gridview template columns for

Hi,

I'm pulling data into a gridview and allowing the user to update the data in template columns (textboxes). I want to validate the data entered on the client side by iterating through all the cells before I update the DB. I have no problem accessing the value of non-template Gridview cells using the following code

document.getElementById("<%=grdEmployeeBudget.Clie ntID %>").rows[1].cells[0].innerText;

but it returns an empty string on the template columns. Any ideas on how to access those cell values? thanks in advance for the help!!



  #2 (permalink)  
Old January 6th, 2007, 11:10 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I got the answer from another forum, so I thought I'd post the answer. This code grabs the value from anything that's an "input" control and dumpit into an array - validations easy from there.

function validateGridData()
{
var inputs = [];
var i;
inputs = document.getElementById("<%=grdEmployeeBudget.Clie ntID %>").getElementsByTagName("input");

for (i in inputs)
{
if (i != "length")
{
if (isNaN(inputs[i].value) == true || inputs[i].value.length < 1)
return false;
}
}
return true;
}

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering Template columns in Detailsview shashipandey ASP.NET 2.0 Professional 0 September 20th, 2007 04:58 AM
getting values from template columns itemtemplate Laxmikant_it ASP.NET 1.0 and 1.1 Professional 4 February 6th, 2007 04:19 PM
Template Columns in a Datagrid Greg Griffiths ASP.NET 1.0 and 1.1 Basics 1 October 28th, 2004 08:02 AM
Template Columns in DataGrids jbenson001 ASP.NET 1.x and 2.0 Application Design 19 September 19th, 2004 08:48 AM
Template Columns in DataGrids jbenson001 ASP.NET 1.x and 2.0 Application Design 3 March 12th, 2004 11:01 AM



All times are GMT -4. The time now is 02:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.