raven
02-07-2003, 11:37 AM
I am using the following function to update a parent window with a value selected in a child window:
function updatetext(SOURCE,TARGET)
{
opener.document.all[TARGET].innerHTML=document.all[SOURCE].value;
}
This is called using:
onChange="javascript:updatetext('txtTown','divTown');">
In this example txtTown is the form field name in the child window and divTown is the div name in the parent window.
This works fine for a text input field, but for a select field the parent window div is update with the value, which is numeric, and I want to pass the associated text. For example:
<select name="cboCountry">
<option value=1 id=England>England</option>
Using:
onChange="javascript:updatetext('cboCountry','divCountry');"
updates the parent window to the value 1.
How do I get this to update the parent to the text, in this case "England"?
function updatetext(SOURCE,TARGET)
{
opener.document.all[TARGET].innerHTML=document.all[SOURCE].value;
}
This is called using:
onChange="javascript:updatetext('txtTown','divTown');">
In this example txtTown is the form field name in the child window and divTown is the div name in the parent window.
This works fine for a text input field, but for a select field the parent window div is update with the value, which is numeric, and I want to pass the associated text. For example:
<select name="cboCountry">
<option value=1 id=England>England</option>
Using:
onChange="javascript:updatetext('cboCountry','divCountry');"
updates the parent window to the value 1.
How do I get this to update the parent to the text, in this case "England"?