I have a popup lookup page which lets the user search for a company name, then a dropdown is populated with the results. The user then clicks on one of the results and the previous page's (window.opener) text field is populate with the value from the selected item, and the popup window automatically closes. Works well so far, but I'm only able to pass back the value, whereas I need to also pass back the text/option of that selection. I thought changing the
=document.getElementById('" + ddlSupplier.ClientID + "').value to =document.getElementById('" + ddlSupplier.ClientID + "').selectedIndex would do the trick but it doesn't work. Nothing gets passed back. I'm guessing is trickier than that b/c this is sharepoint.
Here's the relevant c# code:
=document.getElementById('" + ddlSupplier.ClientID + "').value to =document.getElementById('" + ddlSupplier.ClientID + "').selectedIndex would do the trick but it doesn't work. Nothing gets passed back. I'm guessing is trickier than that b/c this is sharepoint.
Here's the relevant c# code:
Code:
string theTxtVal;
theTxtVal = Request.QueryString["cid"];
string theHidVal;
theHidVal = Request.QueryString["hid"];
ddlSupplier.Attributes.Add("onChange", "window.opener.document.getElementById('" + theTxtVal + "').value=document.getElementById('" + ddlSupplier.ClientID + "').selectedIndex;window.close();");