+ Start a Discussion

iframe newbie

I would like to display an iFrame on a custom object record page and pass a value from one of the fields to the URL.

For example I have the value abcdefg on my record, so i need to pass that to the URL

So let say the full URL should be:

I've looked at this page but it doesn't help me that much as I am an Apex and VF newbie.

How would I do this?!
Ashish DevAshish Dev
For iFrame you need to construct the "src" url in javascript and set it from javascript itself like shown below.

function setSrcIFrame() { 
   document.getElementById('myIframe').src = "http://exampleexample.com"; 

<iframe id="myIframe" src="http://example.com/" "></iframe>
apex:iframe can be used as well.
You might also need to hide iframe until you do not change URL.
Call "setSrcIFrame" from button click after which iframe is loaded or on pageload.
I'm afriad that doesn't mean much to me. I'm a beginner unfortunately.

Is there a tutorial online somewhere maybe? I did some googling but couldn't find anything helpful