Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    coldfusion: onclick to pass a value to display in an iframe

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



    please help me. thanks.

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    476
    Thanks
    2
    Thanked 70 Times in 69 Posts
    Try giving the iframe an ID, and then you can tell it what to load. Ex:

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •