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

01-26-2011, 01:56 AM

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).


please help me. thanks.

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>