Jump to content

Automaticall Adjust Iframe Size?


yjmha
 Share

Recommended Posts

Hi there, Quite new here, also quite new to JS, so pleae bear with me.What I like is a page with top frame which hold a form, with several dropdown list and one submit button,I want user to be able to set the condition by selecting the dropdown, then hit the submit button to load someexisting html page (created already). The html page should be loaded into the middle area of the page (iframe).I also need a bottom area to show some footnote, ideally should be linked to each html page loaded intothe middle area. The following code works so far. But the problem is that when my user change their screen resolution,the dropdown list or footnote area may not show properly, because the size of iframe is hardcoded. <html><head><HTML><Head><script Language=JavaScript> function Runreport() { if (document.getElementById('dropdown1').value=='A' && document.getElementById('dropdown2').value=='X') {parent.iframe.location='jstest2.html'} else if (document.getElementById('dropdown1').value=='A' && document.getElementById('dropdown2').value=='Y') {parent.iframe.location="http://www.yahoo.com"} }</SCRIPT></head><body><form name="main"> Set the filter to select the rerpot you want<br /><select name="dropdown1" style="font-size:10px"> <option value="A">A</option> <option value="B">B</option></select><select name="dropdown2" style="font-size:10px"> <option value="X">X</option> <option value="Y">Y</option></select><input type="button" style="font-size:10px" value="Get Report" name="yyy" onClick="Runreport(); return true"></form><iframe name="iframe" frameborder="" height="400px" width="100%">sadasfd</iframe><br /><p>some footnote here</P></body></html>Any idea how can I fix it? I've searched around, and found some lead, but none of them seem to work so far. Thanks YJM

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...