Dual Submit Function

Discussion in 'JavaScript' started by burnettmarketing@cox.net, Oct 30, 2007.

  1. #1
    Hello,
    I am trying to get my submit button to continue it's form action
    <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post">
    and
    email the form: emailme@email.com at the same time

    Any help would be appreciated.

    I don't think you need the source code but here it is anyways:
    <?php include("HOP.php") ?>

    <?
    $amount_second=$_POST["amount_first"];
    $TitheOffering_second=$_POST["TitheOffering_first"];
    $AriseNBuild_second=$_POST["AriseNBuild_first"];
    $TVMinistry_second=$_POST["TVMinistry_first"];
    $Benevolence_second=$_POST["Benevolence_first"];
    $Missions_second=$_POST["Missions_first"];
    $Other_second=$_POST["Other_first"];
    $OtherOffering_second=$_POST["OtherOffering_first"];
    $ChildrensMin_second=$_POST["ChildrensMin_first"];
    $YouthMin_second=$_POST["YouthMin_first"];
    $PartnersWithPurpose_second=$_POST["PartnersWithPurpose_first"];

    $billTo_firstName_second=$_POST["billTo_firstName_first"];
    $billTo_lastName_second=$_POST["billTo_lastName_first"];
    $billTo_street1_second=$_POST["billTo_street1_first"];
    $billTo_city_second=$_POST["billTo_city_first"];
    $billTo_state_second=$_POST["billTo_state_first"];
    $billTo_country_second=$_POST["billTo_country_first"];
    $billTo_postalCode_second=$_POST["billTo_postalCode_first"];
    $billTo_phoneNumber_second=$_POST["billTo_phoneNumber_first"];
    $billTo_email_second=$_POST["billTo_email_first"];
    ?>

    <CENTER>
    <body bgcolor="#F5E3A8">
    <CENTER>
    <p>
    <img border="0" src="http://www.wordoflifelasvegas.com/images/MerchantLogo1.jpg" width="468" height="60"></p>
    <h1><font face="Verdana">Online Donations Form<br>
    <span style="font-weight: 400"><font size="2">Please confirm your donation(s).<br>
    Press BACK on your browser to make corrections.<br>
    Press Continue below to proceed.</font></span></font></h1>

    <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post">

    <?php InsertSignature($amount_second, "usd") ?>

    The amount entered was: $<?php echo $amount_second; ?> <br>
    Your Tithe/Offering was: <?php echo $TitheOffering_second; ?> <br>
    Your Arise & Build Offering was: <?php echo $AriseNBuild_second; ?> <br>
    Your TV Ministry Offering was: <?php echo $TVMinistry_second; ?> <br>
    Your Benevolence Offering was: <?php echo $Benevolence_second; ?> <br>
    Your Missions Offering was: <?php echo $Missions_second; ?> <br>
    Your Other Offering was: <?php echo $Other_second; ?> <?php echo $OtherOffering_second; ?> <br>
    Your Children's Ministry Offering was: <?php echo $ChildrensMin_second; ?> <br>
    Your Youth Ministry Offering was: <?php echo $YouthMin_second; ?> <br>
    Your Partner's with Purpose Offering was: <?php echo $PartnersWithPurpose_second; ?> <br>

    <br>
    Your First Name: <?php echo $billTo_firstName_second; ?> <br>
    Your Last Name: <?php echo $billTo_lastName_second; ?> <br>
    Your Address: <?php echo $billTo_street1_second; ?> <br>
    Your City: <?php echo $billTo_city_second; ?> <br>
    Your State: <?php echo $billTo_state_second; ?> <br>
    Your Country: <?php echo $billTo_country_second; ?> <br>
    Your Postal Code: <?php echo $billTo_postalCode_second; ?> <br>
    Your Phone Number: <?php echo $billTo_phoneNumber_second; ?> <br>
    Your Email Address: <?php echo $billTo_email_second; ?> <br>

    <br>

    <input type="hidden" name="TitheOffering" value="<?php echo $TitheOffering_second ?>">
    <input type="hidden" name="ArisenBuild" value="<?php echo $AriseNBuild_second ?>">
    <input type="hidden" name="TVMinistry" value="<?php echo $TVMinistry_second ?>">
    <input type="hidden" name="Benevolence" value="<?php echo $Benevolence_second ?>">
    <input type="hidden" name="Missions" value="<?php echo $Missions_second ?>">
    <input type="hidden" name="Other" value="<?php echo $Other_second ?>">
    <input type="hidden" name="OtherOffering" value="<?php echo $OtherOffering_second ?>">
    <input type="hidden" name="ChildrensMin" value="<?php echo $ChildrensMin_second ?>">
    <input type="hidden" name="YouthMin" value="<?php echo $YouthMin_second ?>">
    <input type="hidden" name="PartnersWithPurpose" value="<?php echo $PartnersWithPurpose_second ?>">

    <BR>
    <input type="hidden" name="billTo_firstName" value="<?php echo $billTo_firstName_second ?>">
    <input type="hidden" name="billTo_lastName" value="<?php echo $billTo_lastName_second ?>">
    <input type="hidden" name="billTo_street1" value="<?php echo $billTo_street1_second ?>">
    <input type="hidden" name="billTo_city" value="<?php echo $billTo_city_second ?>">
    <input type="hidden" name="billTo_state" value="<?php echo $billTo_state_second ?>">
    <input type="hidden" name="billTo_country" value="<?php echo $billTo_country_second ?>">
    <input type="hidden" name="billTo_postalCode" value="<?php echo $billTo_postalCode_second ?>">
    <input type="hidden" name="billTo_phoneNumber" value="<?php echo $billTo_phoneNumber_second ?>">
    <input type="hidden" name="billTo_email" value="<?php echo $billTo_email_second ?>">

    <input type="hidden" name="orderPage_transactionType" value="authorization">


    <input type="submit" name="submit" value="Continue">

    </form>

    </body>
    </html>

    Thanks in advance
     
  2. ezpz

    ezpz Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know about dual submitting the form, but you can chain the two together at the server side. I use nms FormMail (http://nms-cgi.sourceforge.net/scripts.shtml), which sends an e-mail and then forwards the request on to another script.
     
    ezpz, Oct 30, 2007 IP
  3. schoash

    schoash Active Member

    Messages:
    291
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #3
    you can use a js function for submitting it right out of the form.

    Using script.aculo.us you can do it like this

    
    <form id="order" action="" method="post">
    ...
    ..
    ..
    <input name="Continue" type="button" onClick="s()" />
    </form>
    <script>
    function s(){
    	new Ajax.Request('https://orderpage.ic3.com/hop/orderform.jsp?'+Form.serialize($('order'));
    	new Ajax.Request('sendemailtome.php?'+Form.serialize($('order'));
    	
    }
    </script>
    
    PHP:
    and just implement a simple script which catches the $_POST
    
    <?
    foreach($_POST as $key=>$value)
    	$ret.=$key.': '.$value.'\n';
    
    mail('myemail@dsf.com', 'Subject', $ret );
    ?>
    PHP:
     
    schoash, Oct 31, 2007 IP