SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member balaji_A's Avatar
    Join Date
    Mar 2004
    Location
    India
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    submit a page present in IFrame

    I have a html page containing one button and IFrame.

    Parent.html

    <html>
    <input type=button >Submit</input>
    <iframe src="ifrm.html" name=ifrm></iframe>
    </html>

    IFRM.html

    <html>
    <form name=iform action="sam.jsp">
    Name input type=text name="name"><br>
    Age input type=text name="age"></br>
    <input type=submit>
    </form>
    </html>

    So what i want to acheive is on click of the submit button present in the parent.html the page IFRM.html should get posted.

    Is it possible to do?

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a note on terminology: you're not 'posting the page', you're submitting a form.
    Code:
    <input type="button" onclick="return submit_iform()">Submit</input>
    .............
    .............
    function submit_iform()
    {
         var oIframe;
         if ((oIframe = frames.ifrm) && oIframe.document.iform)
              oIframe.document.iform.submit();
         return false;
    }
    .............
    ::: certified wild guess :::


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •