Wednesday, April 20, 2005

Passing Textbox value form a Child Window to Parent Window Using JavaScript...

There are many a time when you might want to open a child window for showing a calendar and returning the selected value to the parent form text box,

Here's how to do it using JavaScript.

Open the HTML view of the child form, include this as a javascript function and call it on Unload of the child form or on button click.

window.opener.document.getElementById('txtParent').value = window.document.getElementById('txtChild').value

In the parent form you can open the child window by using window.open in the Response.Write method.
Check out my other post on the using the window.open parameters.

No comments: