Accessing parent window form from child window in html


Accessing parent window form from child window in html

window.parent.document.parentFormName.submit();

Here parentFormName is the name of Form of parent window that you want to submit from child window.
Ex, <form name="parentFormName".....>


Accessing parent window's form input parameters to child window,

var userName= window.parent.document.getElementById('userName').value;

Here userName is the id element of input field on parent form.
Ex.
    <form name="parentFormName".....>
<input type="text" id="userName" />
</form>
---------------------------------------------------------------------------------------------------------------

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Session timeout interceptor in struts 2