I am making a search engine and I have a few issues with my iframe. When a user clicks enter, an iframe is created. I want the iFrame to get as much height as it needs so it blends in with the rest of the page. Here is my code:
<input type="search" id="q" name="q"/>
<input type="submit" value="Search" onclick="submit(); return false;"/>
<script>
function submit() {
page.innerHTML = '<iframe id="results" src="" frameborder="0" scrolling="no" style="overflow:hidden; overflow-x:hidden; overflow-y:hidden; height:150%; width:99%; position:absolute;" height="150%" width="99%" onload=""/>';
document.getElementById('results').src = 'search.php?q=' + query + '&session=<?=$custom_session;?>&no-cache=' + Math.random();
}
</script>
This is a cut down version of the script. The actual page is located at - http://v1k.me/search/alpha/ If you look at the HTML, you will be able to see the whole code.
If you search "mobile", the results will be cut off at 9th result (https://i.stack.imgur.com/yphai.png), however if you search say "mail", it will display everything and will stop halfway of the page list.