Hi,
I have to set the value of a textbox in a parent window from child window. The problem I am having is that the text field names in the parent window are numaric and when I am trying to set the value its not able to identify that html element.
Here is what I have, the openWindow will popup a window and popup window will set the value of param1 in the parent window and closes.
Parent window
ChildWindow this is the script that puts the value for textfield 38. The param1 will have the inputField Name
This code works when the text field name in the paramentForm is of type String.
Help is appriceated.
Thanks
Gorge
I have to set the value of a textbox in a parent window from child window. The problem I am having is that the text field names in the parent window are numaric and when I am trying to set the value its not able to identify that html element.
Here is what I have, the openWindow will popup a window and popup window will set the value of param1 in the parent window and closes.
Parent window
Code:
<form name="form0">
<input type="text" name="38" value="123"><img src="icon.find.gif" onClick="openWindow('findLocation.do?param1=38')" />
</form>
ChildWindow this is the script that puts the value for textfield 38. The param1 will have the inputField Name
Code:
function setValues(param1, selectedValue){
var parentForm = window.opener.document.forms(0);
var parentField = eval("window.opener.document." + parentForm.name + "." + param1 );
parentField.value = selectedValue;
window.close();
}
This code works when the text field name in the paramentForm is of type String.
Help is appriceated.
Thanks
Gorge