开发者

javascript-how enable controls of a parent window from child window

开发者 https://www.devze.com 2022-12-20 17:55 出处:网络
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 windo

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

精彩评论

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

关注公众号