Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
45
rated 0 times [  47] [ 2]  / answers: 1 / hits: 26601  / 11 Years ago, mon, august 5, 2013, 12:00:00

I have below two html files. In PassValueIFrame.html i have an iframe which refers inputForm.html. Also, i have one hidden field in PassValueIFrame.html and am trying to retrieve its value in inputForm.html but am not getting its value it alerts as 'undefined'. Am i doing any wrong here? Please help me.



PassValueIFrame.html



<html>
<head>
<title>IFrame Example</title>
</head>
<body>
<input type=hidden class=Language value=English>
<iframe name=iframe id=iframe_id src=inputForm.html height=150 >
</iframe>
</body>
</html>


inputForm.html



<html>
<head>
<script src=http://code.jquery.com/jquery-1.10.1.min.js></script>
<script language=javascript>
$(document).ready(function() {
alert($(this).parent().find('.Language').html());
});

</script>
<title>IFrame Child Example</title>
</head>
<body>
<h1> Iframeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee </h1>
</body>


Thanks!


More From » jquery

 Answers
18
<input id=myInput type=hidden class=Language value=English>

$(#myInput, window.parent.document).val();

[#76525] Friday, August 2, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
cruzs

Total Points: 710
Total Questions: 113
Total Answers: 100

Location: Nepal
Member since Sat, Jul 18, 2020
4 Years ago
cruzs questions
Thu, Nov 26, 20, 00:00, 4 Years ago
Wed, Oct 28, 20, 00:00, 4 Years ago
Wed, Aug 19, 20, 00:00, 4 Years ago
Sun, Aug 2, 20, 00:00, 4 Years ago
;