Note that there are some explanatory texts on larger screens.

plurals
  1. POInput multiple iFrame Source from Form Input with http
    primarykey
    data
    text
    <p>I have the following code that I found on here. If I type in <a href="http://google.com" rel="nofollow">http://google.com</a></p> <p>It loads google.com into the iframe.</p> <p>My question is, </p> <ol> <li><p>How can I have more than 1 iframe to be filled</p></li> <li><p>Can I have it so that I do not have to put in http:// just the domain, google.com</p></li> </ol> <p>Thanks, Here is the code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Blah&lt;/title&gt; &lt;link href="style.css" rel="stylesheet" type="text/css"/&gt; &lt;script type="text/javascript"&gt; function SetSrc() { document.getElementById("myIfreme").src = document.getElementById("txtSRC").value; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; Enter URL: &lt;input type="text" id="txtSRC" /&gt; &lt;input type="button" value="GO" onclick="SetSrc()" /&gt; &lt;/form&gt; &lt;iframe id="myIfreme" src="" frameborder="0" marginwidth="0" height="500" width="480"&gt; &lt;/iframe&gt; &lt;iframe id="myIfreme" src="" frameborder="0" marginwidth="0" height="500" width="840"&gt; &lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks alot. That is exactly what I was looking for! Here it is completed:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link href="style.css" rel="stylesheet" type="text/css" /&gt; &lt;title&gt;Blah&lt;/title&gt; &lt;script type="text/javascript"&gt; function SetSrc() { document.getElementById("myIfreme1").src = 'http://' + document.getElementById("txtSRC").value; document.getElementById("myIfreme2").src = 'http://' + document.getElementById("txtSRC").value; document.getElementById("myIfreme3").src = 'http://' + document.getElementById("txtSRC").value; document.getElementById("myIfreme4").src = 'http://' + document.getElementById("txtSRC").value; document.getElementById("myIfreme5").src = 'http://' + document.getElementById("txtSRC").value; document.getElementById("myIfreme6").src = 'http://' + document.getElementById("txtSRC").value; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form&gt; Enter URL: http:// &lt;input type="text" id="txtSRC" /&gt; &lt;input type="button" value="GO" onclick="SetSrc()" /&gt; &lt;/form&gt; &lt;div style="clear:both"&gt;320 width&lt;/div&gt; &lt;iframe id="myIfreme1" src="" frameborder="0" marginwidth="0" height="480" width="320" scrolling="yes"&gt;&lt;/iframe&gt; &lt;div style="clear:both"&gt;480 width&lt;/div&gt; &lt;iframe id="myIfreme2" src="" frameborder="0" marginwidth="0" height="480" width="480" scrolling="yes"&gt;&lt;/iframe&gt; &lt;div style="clear:both"&gt;640 width&lt;/div&gt; &lt;iframe id="myIfreme3" src="" frameborder="0" marginwidth="0" height="480" width="640" scrolling="yes"&gt;&lt;/iframe&gt; &lt;div style="clear:both"&gt;800 width&lt;/div&gt; &lt;iframe id="myIfreme4" src="" frameborder="0" marginwidth="0" height="480" width="800" scrolling="yes"&gt;&lt;/iframe&gt; &lt;div style="clear:both"&gt;1024 width&lt;/div&gt; &lt;iframe id="myIfreme5" src="" frameborder="0" marginwidth="0" height="480" width="1024" scrolling="yes"&gt;&lt;/iframe&gt; &lt;div style="clear:both"&gt;1280 width&lt;/div&gt; &lt;iframe id="myIfreme6" src="" frameborder="0" marginwidth="0" height="480" width="1280" scrolling="yes"&gt;&lt;/iframe&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>THANKS alfasin - You are AWESOME!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload