...

View Full Version : coldfusion: onclick to pass a value to display in an iframe



thevamps
01-26-2011, 01:56 AM
hello.

i'd like to ask for help/advice from anyone out there.

what i am doing right now is to display a list of documents in one page. when a user select (click) to one of the list, they will be able to view the PDF file in the iframe beside that list. The question is: How to pass a value to an iframe in the same page? (picture below explains how it should work).

http://img97.imageshack.us/img97/280/iframe.jpg

please help me. thanks.

Gjslick
01-27-2011, 03:16 AM
Try giving the iframe an ID, and then you can tell it what to load. Ex:



<iframe id="myIframe"></iframe>
<a href="#" onclick="document.getElementById('myIframe').src='somepdf.pdf'; return false;">Load PDF</a>


-Greg



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum