Reputation: 7921
I know that you can disable an input field like this:
<input disabled></input>
But is there a simple way to disable all the inputs within an iFrame a similar way? Like this:
<iframe src="/foo" disabled></iframe>
Upvotes: 0
Views: 1287
Reputation: 7921
Unfortunately no answers have been satisfactory (or they just didn't answer the correct question), so I am answering my own.
The answer I've found from the documentation on the properties/attributes has led me to believe it is impossible. Since I was using an iframe from a source I could modify, I fixed what I needed to there, but it would have been a much cleaner and DRYer solution if this were possible.
Upvotes: 1
Reputation: 11
I think its not possible to disable an iframe but you can use a div over the iframe to avoid user interaction
<div id="blank" style="display:none; position:absolute; top:100px; left:100px; width:600px; height:400px;">
changing top left width and height with the coordinates and size of your iframe
and when you want to disable iframe
document.getElementById("blank").style.display="block";
if you want to disable iframe since load just change display none to block on the original div
I hope this helps :)
Upvotes: 0