I have the following HTML
Affiliate Party
-
Script on parent page:
$(".PartyLookupToggle").click(function () {
var id = $(this).prev().prev().attr("id");
var name = $(this).prev().attr("id");
var url = "PartySearch.aspx?id=" + id + "&name=" + name;
window.open(url, "PartySearch", "width=400,height=50");
return false;
});
Script on child page:
// Get the values from the URL using the jquery.query plug-in
var id = $.query.get("id");
var name = $.query.get("name");
// Get the values from the drop down
var newPartyId = $("#ddlMatchingParties").val();
var newPartyName = $("#ddlMatchingParties option:selected").text();
// Set them to the parent window
window.opener.$("#" + id).val(newPartyId);
window.opener.$("#" + name).val(newPartyName);
// Close the popup
window.close();
- 热议问题