code_junkie

accessing a form that is in an iframe

Nov 13th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. var ifr = document.getElementById( yourIframeId );
  2. var ifrDoc = ifr.contentDocument || ifr.contentWindow.document;
  3. var theForm = ifrDoc.getElementById( yourFormId );
  4.  
  5. myframe.document.getElementById("myform") // gives you the form element
Add Comment
Please, Sign In to add comment