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/