0

My HTML:

<table>
  <tr>
    <td id="mainform">
      <iframe id="ifSur"></iframe>
    </td>
    <td id="subform"></td>
  </tr>
</table>

In iframe the 1.aspx page will be loaded. So the height of subform td must be the height of <form> tag in 1.aspx.

  • This stack post will probably help http://stackoverflow.com/questions/819416/adjust-width-height-of-iframe-to-fit-with-content-in-it – Luke Baughan Oct 10 '12 at 13:31

1 Answers1

0

In 1.aspx's load event, call a function on the parent frame, passing the form height.

window.parent.adjustTD(document.myForm.offsetHeight);

(I'm assuming the form's name is "myForm"; if not, adjust the code accordingly.) On the parent:

function adjustTD(inHeight)
{
   document.getElementById("subform").style.height = inHeight.toString() + "px";
}

Untested code, may require debugging, etc., etc. Are you sure its "subform" you want to adjust, and not "mainform"?

MarkFisher
  • 516
  • 4
  • 15