Selecting a dropdown list from a child window
Posted on 2005-04-12
I have opened a new window from the parent window and this is used to search for extra information and when found, I close this window sending the results back to the parent window populating some text and textarea with the information.
Here is where i'm struggling:
On the parent window, I have a select/option list pre-populated with values. The 'value' has an integer value 312,231,23,98 etc.. and these have text place names which are displayed in the list itself. What I need to do is send for example 312 from the child window back to the parent window and to change the selection to the correct option sent from the child window.
Here is the code i'm using on the child window to populate the other options on the parent window. The line which has 'window.opener.document.fault.frm_franchise.value' is the line of code in question.
window.opener.document.fault.frm_postcode.value = document.results.hid_postcode.value;
window.opener.document.fault.frm_node.value = document.results.hid_node_ref.value;
window.opener.document.fault.frm_dhcp.value = document.results.hid_dhcp_name.value;
window.opener.document.fault.frm_ubr.value = document.results.hid_ubr_dns.value;
window.opener.document.fault.frm_customers.value = document.results.hid_customers.value;
window.opener.document.fault.frm_franchise.value = document.results.hid_franchise_no.value;