Script: Adding an iframe
This article will help you add code to a question so you can have a self contained scrollable section within your survey
Background
There are are cases in which you want to add a scrollable window within your survey. This is usually used when displaying terms and conditions.
Instructions
- Make sure you have the link to the content you want to be displayed within your iframe. There are 2 different options here:
- This can be an external link hosted by a third party OR
- You can upload the corresponding file that you have made to the 'File Upload' Card
- Program your question
- Access the 'Source Code Editor' section in the field you want the iframe to appear in and add the code below. Make sure to replace your link in the code below.
- See article: Source Code Editor
<iframe src="https://your_link_here.pdf">Your browser does not support iframes</iframe>
- Add the following code to the '+ CSS' field
- See article: Adding JavaScript and/or CSS to a Question
- This code will allow you to format your iframe as needed
iframe { display: block; width: 90%; min-height: 300px; margin: 0 auto; }
- Make sure to test