I have got the script below which I am using to pass a variable to a URL. When I click the search button it redirects to the URL including the variable in the text box however what I need to do is open the page in an iframe that opens beneath the search box so I can search again with the box still visible.
Any assistance would be much appreciated.
Many thanks,
Martyn.
P.S. I have removed the spreadsheet code from the URL.
<!DOCTYPE html>
<html>
<body>
Search by word (case sensitive):<br>
<input type="text" id="urlInput" value="">
<input type="hidden" id="urlInput2" value="%22">
<button onclick="redirect()">Search</button>
<script>
function redirect() {
var url = "https://docs.google.com/spreadsheets/d/XXXXXXXXXXXXXXXXXX/gviz/tq?tqx=out:html&tq=SELECT%20*%20where%20B%20contains%20%22" + document.getElementById('urlInput').value + document.getElementById('urlInput2').value;
window.location=url;
}
</script>
</body>
</html>