R
Rob Meade
Hi all,
firstly, sorry if this is deemed off topic - at work we only have access to
the MS newsgroups and I dont see a Javascript one listed
Ok - so the question.
I have datagrid on a popup window which for each row spat out has a
"Select" option - its a hyperlink - when clicked it runs the calls a
javascript function - this function should populate the parent form, my
problem is that I need to update the fields dynamically - ie, I wont know
what the field name actually is...
The code I have thus far:
Calling the function:
<a class="normalText" href="javascript:void(0);"
onclick="populateForm('<%=Request.QueryString("controlid") %>', '<%#
DataBinder.Eval(Container.DataItem, "CrfExpansion") %> ','<%#
DataBinder.Eval(Container.DataItem, "CrfDHANationalCode") %>');">Select</a>
The function:
function populateForm(controlID, displayValue, hiddenValue)
{
opener.document.form1.controlid.value = displayValue;
}
The reason that there are more values coming into the function is because
there are some further plans with this, it will infact update 2 fields on
the parent form - but I wanted to get one working first!
As you can see I have controlID in this line:
opener.document.form1.controlid.value = displayValue
but I believe its actually using that as text, rather than the value it
holds and thus returns an error about the object being null etc..
Any help would be appreciated,
Regards
Rob
firstly, sorry if this is deemed off topic - at work we only have access to
the MS newsgroups and I dont see a Javascript one listed
Ok - so the question.
I have datagrid on a popup window which for each row spat out has a
"Select" option - its a hyperlink - when clicked it runs the calls a
javascript function - this function should populate the parent form, my
problem is that I need to update the fields dynamically - ie, I wont know
what the field name actually is...
The code I have thus far:
Calling the function:
<a class="normalText" href="javascript:void(0);"
onclick="populateForm('<%=Request.QueryString("controlid") %>', '<%#
DataBinder.Eval(Container.DataItem, "CrfExpansion") %> ','<%#
DataBinder.Eval(Container.DataItem, "CrfDHANationalCode") %>');">Select</a>
The function:
function populateForm(controlID, displayValue, hiddenValue)
{
opener.document.form1.controlid.value = displayValue;
}
The reason that there are more values coming into the function is because
there are some further plans with this, it will infact update 2 fields on
the parent form - but I wanted to get one working first!
As you can see I have controlID in this line:
opener.document.form1.controlid.value = displayValue
but I believe its actually using that as text, rather than the value it
holds and thus returns an error about the object being null etc..
Any help would be appreciated,
Regards
Rob