code_junkie

Get radio value inside iframe

Nov 11th, 2011
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <form id="myForm">
  2. <iframe>
  3. <!-- Normal HTML headers omitted -->
  4. <input type=radio name="myRadio" value=1>First
  5. <input type=radio name="myRadio" value=2>Second
  6. <input type=radio name="myRadio" value=3>Third
  7. </iframe>
  8. <input type=button value="Submit" />
  9. </form>
  10.  
  11. $("input[@type=radio][@checked]");
  12.  
  13. var frameDocument = $('#myForm iframe').contentDocument || $('#myForm iframe').contentWindow.document;
  14. $(frameDocument).find('input[type=radio][checked]');
Add Comment
Please, Sign In to add comment