Thursday, December 31, 2020

Transfer a textbox content of a popup window to a textbox of parent page


Transfer a textbox content of a popup window to a textbox of parent page

 <script type="text/javascript">      

    document.getElementById('Button2').onclick = function () {

        if (window.opener != null && !window.opener.closed) {

            var txtNew = window.opener.document.getElementById("TextBox1");

            txtNew.value = txtNew.value + "\n\n" + document.getElementById("TextBox_sms").value;

        } 

        window.close();

    }       

</script>


No comments: