Button and iframe

Use this board to ask questions or have discussions with other Atrium users.
Post Reply
alexisa
New User
Posts: 1
Joined: Tue Jan 23, 2018 5:37 am
First Name: alexis
Last Name: alabert
Company Name: Loiselet
Country: France
Contact:

Button and iframe

Post by alexisa »

Hi

I create a new project with 4 select box, a button and a iframe.
I wish that when I click on the button, I activate my iframe, and as url I pass him the value of the select box.

In the property "onclick" of my button, i have this :

Code: Select all

textTextArea.value = typdoc.value + SERVIC.value + IMMEUB.value + coddoc.value;

IFrame1.url =  "http://192.168.0.88/test3.html";
IFrame1.visiblility = "visible";
applyProperty("IFrame1", "iframe url", "http://192.168.0.88/test3.html");
It does not work.
Can you help me ?

Thank you
User avatar
Emily
Profound Logic Staff Member
Posts: 89
Joined: Tue Jun 21, 2016 8:30 am
First Name: Emily
Last Name: Seage
Company Name: Profound Logic
Contact:

Re: Button and iframe

Post by Emily »

Alexis,

For clarification, are you saying that you want to get the value of your select box and use this value as the 'iframe url' property for your iFrame? If this is what you're wanting, you should be able to accomplish this. Please see the example below. Note that in this example, we are only getting the value for one select box but this should give you an idea of how to accomplish this.

In this example, we have a drop down with one option. We set up the select box with the following properties:
select.png
select.png (4.96 KiB) Viewed 1348 times
On this screen, we have a 'Show iFrame' button. In the onclick event for this button, we use the following:

Code: Select all

var value = get('Dropdown1');

applyProperty('IFrame1', 'visibility', 'visible');

applyProperty('IFrame1', 'iframe url', value);
applyProperty('IFrame1', 'field type', 'iframe');
This will get the value of the select box with an id of 'Dropdown1' using the get() API. If you aren't familiar with this API, you can learn more about it in our documentation here: http://www.profoundlogic.com/docs/pages ... Id=3276803. Then, we use the applyProperty() API to change the visibility of the iFrame to visible. We also use applyProperty() to set the 'iframe url' property to the value of the select box by using the variable value for the propValue parameter.

After we change the 'iframe url' property of the iframe widget, we will need to re-render the iFrame to show the changes. We do this by re-applying the 'field type' property, as you can see in the last line above.

Now, when we run our program and choose 'Profound Logic Website' from the drop down, the iFrame will use http://www.profoundlogic.com for the 'iframe url' property:
result.png
result.png (24.05 KiB) Viewed 1348 times
Hopefully this example helps with what you're wanting to accomplish!

Thanks!

--Emily C.
Emily Seage
Support Team Lead
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest