PDA

View Full Version : Changing iframe src with dropdown



ConnorJack
Oct 5th, 2009, 08:08 PM
Hi,
I have a page with a dropdown and an iframe. Is there way I can connect the two? For example, a user comes on my site. They select an item from the dropdwon and then the iframe src changes?

Scriptet
Oct 5th, 2009, 09:21 PM
You want to change the content of an iFrame on click? You can set the target of the link to the name of the iFrame like this:
Link:
<a target="frameName" href="file.html">File</a>

iFrame:
<iframename="frameName" src="original.html"></iframe>

And the contents of the file.html will be loaded into the frame and replace the contents of original.html on clicking the link.

ConnorJack
Oct 6th, 2009, 08:18 PM
You want to change the content of an iFrame on click? You can set the target of the link to the name of the iFrame like this:
Link:
<a target="frameName" href="file.html">File</a>

iFrame:
<iframename="frameName" src="original.html"></iframe>

And the contents of the file.html will be loaded into the frame and replace the contents of original.html on clicking the link.

Thanks for your reply, but this isn't what I was looking for. I wanted to do this through a dropdown rather than a link. But doesn't matter, doing it througn a whole different system now!