javascript-how enable controls of a parent window from child window
My requiremen开发者_如何学运维t is as follows on click of a begin button a popup window opens up and begin button gets disabled. now when the user clicks the "done" button present on the child window the "begin" button on the parent window should get enabled.
Use window.opener
to get the parent window, and find the element using document.getElementById
.
window.opener.document.getElementById("yourbuttonid").disabled = false;
IN PARENT WINDOW DO:
- disable begin button
- open the childwindow
IN CHILD WINDOW DO:
<input type="submit" value="done" onclick="window.opener.document.getElementById('begin').disabled = false;">
精彩评论