Link to home
Start Free TrialLog in
Avatar of interclubs
interclubs

asked on

Change iFrame width and height on submit.

I have a form as such:
<form action="showPage.php" method="post" target="virtualDisplay">
Width : <input type="text" name="viewWidth" value="" /> x Height: <input type="text" name="viewHeight" value="" />
<button type="submit">try me.</button>
</form>

When the form is submitted, I want to change the height/width of an iframe located on the same page (via JavaScript):
<iframe src ="showPage.php" width="xxxx" height="xxxx" name="virtualDisplay">
  <p>Your browser does not support iframes.</p>
</iframe>


Thanks!
Avatar of mmarx82
mmarx82
Flag of United States of America image

Depending on what your doing, it may be better to resize the iframe according to it's contents with an iframe onLoad event.
See link: http://www.guymal.com/mycode/iframe_size/
ASKER CERTIFIED SOLUTION
Avatar of yogi4life
yogi4life
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Please assign points or close this. If you need more help please state so or Request Attention on this. Thanks