开发者

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:

  1. disable begin button
  2. open the childwindow

IN CHILD WINDOW DO:

<input type="submit" value="done" onclick="window.opener.document.getElementById('begin').disabled = false;">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜