473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Retrieve Textbox Value From Datagrid

Hello:

I need to retrieve the value of a textbox control in a asp.net datagrid
using Javascript. Can anybody help out. I believe the control clientID needs
to be passed client side so the javascript can reference. Any idea how.
Thanks
Jul 23 '05 #1
1 7313


Bryan wrote:

I need to retrieve the value of a textbox control in a asp.net datagrid
using Javascript. Can anybody help out. I believe the control clientID needs
to be passed client side so the javascript can reference. Any idea how.

If you have an .aspx page then that has a
<form runat="server">
and in that form you have the datagrid. Make sure you give the form
element a name e.g.
<form name="formName" runat="server">
and then you can access
document.forms.formName.elements.textboxName.value
If the textboxes in your data grid do not have a name then you could go
by the index e.g.
document.forms.formName.elements[index].value

Or in newer browsers you can use the id of the textbox, you could then
use RegisterClientScriptBlock in ASP.NET to create a global, client-side
variable to store the id.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mark Brown | last post by:
I'm new to ASP.NET and I'm trying to create an aspx page that retrieves info from a database, let's the user make a change and write the change back. It reads from the database just fine. The...
1
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
3
by: Nic | last post by:
Hey, I have an ASP-application. In the ASPX I have an <asp:dropdownlist ..>. Now when I leave this control I want to initialisize some other fields. In window forms we uses the onleave event but...
1
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template...
1
by: John Dalberg | last post by:
I have a datagrid plus a button to save the contents of the grid to the database. My code gets blanks in the textbox field. I am not sure why. Also I don't know why dgi.Cells.Controls &...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
3
by: MaryA | last post by:
I have an asp.net application in which i have a form containing a datagrid when using the update command event i have: tb = CType(e.Item.Cells(3).Controls(0), TextBox) subject = tb.Text this code...
2
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's...
2
by: Steve Hershoff | last post by:
Hi everyone, I have a DataGrid with several TemplateColumns. One of these columns has an EditItemTemplate that contains an ASP.Net DropDownList. I'm catching this DropDownList's...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.