Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 6th, 2012  |  syntax: None  |  size: 0.71 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. javascript parent and child window
  2. <a href="javascript:void(0);" style="width:100%; height:125%" onclick="window.open('otherExpenses.php','Ratting','width=350,height=550,left=50,top=50,toolbar=1,status=1,');">Open Child</a>
  3.        
  4. <a href="javascript:void(0);" onclick="post_value()">Close Child</a>
  5.        
  6. function post_value()
  7. {
  8.     opener.document.overHeads.overheadOther.value = document.otherExpenses.TextBox27.value;
  9.     opener.document.overHeads.hiddenOther.value = document.otherExpenses.TextBox27.value;
  10.     //here I want to call a function from the parent window that updates some field in the parent window.
  11.     self.close();
  12. }
  13.        
  14. //w is the child window
  15. w.document.getElementById('theId').onchange(window.somefunction);