Created
November 13, 2012 01:55
-
-
Save lydonchandra/4063438 to your computer and use it in GitHub Desktop.
Iframe jquery access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find myForm in myIframe | |
var $myForm = $('#myIframe').contents().find('#myForm'); | |
// set inputField value in $myForm | |
$('input[name="inputField"]', $myForm).val(JSON.stringify(inputField)); | |
// check checkbox value in $printForm | |
$('input[name="myCheckbox"]', $myForm).val() === 'on' | |
// without jQuery | |
document.myForm.myCheckbox.checked | |
"myValue": document.myForm.mySelectBox.value, | |
"myValue": $('select[name=mySelectBox]', $myForm).val(), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment