SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Submit form on frameA from frameB

    There is a framed site with two frames - frameA and frameB.

    <frameset rows="40%, 60%">
    <frame name="frameA" scrolling=no src="pageA.htm">
    <frame name="frameB" scrolling=no src="pageB.htm">
    </frameset>

    There is a single form on each frame.

    Can Javascript be used to submit the form on frameA when the submit button on form on frameB is clicked?

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be able to. On the first frame in the <form> tag

    <form name="blah" action="" method="post" onsubmit="return submit_other()">

    in the head have
    Code:
    <script language="javascript1.2">
    <!--
    function submit_other()
    {
       top.otherframname.document.formname.submit();
       return true;
    }
    //-->
    </script>
    That should work an submit both forms.
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Is there any reason why you can't assign formB's var/values to hidden var/values in formA, and then submit only one form?

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still


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
  •