S
SergioT
Hi
I wanna to create a jscript function that sets the value of a textbox into a
datagrid, But the problem is How can I obtain the name of the textbox and
send it to my jscript function???? The textbox is in a TemplateColumn
The Idea is sent to the funcion the name of the control and then pass it to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name of
the textbox
This is the call of my fHelpItm jscript function, like you see I associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================
the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world' <<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object and that
is correct because the name sure is something like "Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control
THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye
I wanna to create a jscript function that sets the value of a textbox into a
datagrid, But the problem is How can I obtain the name of the textbox and
send it to my jscript function???? The textbox is in a TemplateColumn
The Idea is sent to the funcion the name of the control and then pass it to
another window and then this child window must set the values of the
control. But for simplicity the problem get reduced to obtain the name of
the textbox
This is the call of my fHelpItm jscript function, like you see I associate
the call to onclick event for the IMG control
==================
<EditItemTemplate>
Codigo<asp:TextBox id="txtCod" runat="server"
Width="87px"></asp:TextBox>
<IMG id="imgBuscar" onclick="javascript:fHelpItm('txtCod')" alt=""
src="../Images/iconBuscar.jpg">
</EditItemTemplate>
==================
the function simplified function is something like this
=======================
function fHelpItm(Codigo)
{
if confirm(' Do you wanna set a value for ' + Codigo)
document.forms[0].elements[Codigo].value ='Hello world' <<<HERE
is the problem
}
=====================
jscript says that the name of the control "txtCod" is not an object and that
is correct because the name sure is something like "Datagrid__ctl2_txtCod"
so the question is How can I obtain the correct name of the control
THANKSSSSSSS FOR YOUR HELP because this is getting me crazy!!!
bye