Monday 20 February 2012

Controlling parent window from popup window


Use the following function

<script langauge="javascript">

function post_value(){

self.close(); //Closing popup window

//Redirecting parent to normal jsp page
window.opener.location.href=" pagename .jsp?item1="+document.frm.textfieldtest.value;

//redirecting parent when tiles is used
window.opener.location.href="pagename";

// assigning a value toa field in parent
opener.document.form1.par_name1.value = document.form2.textfieldtest.value;

}
</script>

No comments:

Post a Comment