Fill parent window text box value from child window

Ankaprasad
Posted by Ankaprasad under jQuery category on | Points: 40 | Views : 323
 $(document).ready(function ()
{
SetCompanyToParentWindow('@ViewBag.status');
}

 function SetCompanyToParentWindow(createStatus) {       
if (createStatus==="True" || createStatus==="true" ) {
var company = $("#txtName").val(); // txtName is child window control id
var parentCompany = $(window.opener.document).find('#txtCompany'); // txtCompany is parent control id

parentCompany.val(company);
window.close();

}
}

Comments or Responses

Login to post response