Passing value from iframe to parent[solved]
Moderator: General Moderators
Passing value from iframe to parent[solved]
How to pass value from iframe to parent?
Last edited by kpraman on Wed Apr 25, 2007 1:17 am, edited 1 time in total.
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
From YourHtmlSource
Hope that helps...
So simply treat the Iframe handling as you would any other frame... If you are unsure of the frame method you can look it up by following the link provided.If you have multiple iframes on the same page you can have them interacting, by sending commands between them, just like normal frames...
Hope that helps...
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
You don't need multiple Iframes but the quote was from the link so I didn't change it. The point being made is that generally Iframes act as normal frames when it comes to moving information between them, either through javascript or forms.
Saying that from your updated information I would have to question why you are using an Iframe. It appears that anything you are doing could be done with HTML and CSS (look up CSS overflow if you need scrolling). To update things on the fly (on radio button change) you would need to insert some javascript as the radio button "onchange" event. The only question is then what happens if someone doesn't have javascript enabled ?
Iframes do have uses but in my opinion they are rarely needed as there are better/simpler alternatives.
Saying that from your updated information I would have to question why you are using an Iframe. It appears that anything you are doing could be done with HTML and CSS (look up CSS overflow if you need scrolling). To update things on the fly (on radio button change) you would need to insert some javascript as the radio button "onchange" event. The only question is then what happens if someone doesn't have javascript enabled ?
Iframes do have uses but in my opinion they are rarely needed as there are better/simpler alternatives.
I almost solved it, why i am getting the error everytime i click on radio button.
error:filename undefined (i.e what ever the file name is)
error:filename undefined (i.e what ever the file name is)
Code: Select all
foreach($filename as $filenames)
{
echo "<input type=radio name=radio onclick=callme($filenames)> $filenames";
echo "<br>";
}
?>Code: Select all
<script language="JavaScript">
function callme(filenames)
{
parent.document.form1.imagename.value ="check";
}
</script>- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Without seeing the rest of your code...
shouldn't the loop be of filenames with the values being $filename rather than the other way around ?
Code: Select all
foreach($filenames as $filename)
{
echo "<input type=\"radio\" name=\"radio\" onclick=\"callme({$filename})\"> {$filename}<br />";
}