Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Mutiple forms on same page issue

    I am attempting to complete a page with 4 different forms.

    the first form is only text fields and has no onsubmit button.

    I need to copy the text fields input to the other form that has a onsubmit handler. Here is the instructions I have been given below, it is confusing to me in how to create the javascript. I thought someone could assist me here thanks.

    Instructions:
    On your page, you have three text fields, and three submit buttons – altogether, these comprise four different forms. Because your three text fields are being included in the first form, and your three submit buttons are located on the other three form, the information entered by the buyer does not get transmitted to PayPal when the buyer clicks on one of these buttons. To solve this, you would need to add six hidden inputs to each of these forms. Three of these fields would need to be named “on0”, “on1”, and “on2” – these should be set to the labels of the text fields, as they should appear on the buyer’s receipt at PayPal (remember that each of these fields is limited to 64 characters). The other three fields would need to be named “os0”, “os1”, and “os2”. You should add some JavaScript code to your form’s onSubmit handler; this code should copy the data from your three text fields into each of these hidden inputs.

    Here is the page online http://hoacommunitymgt.com/content/newpayment.html

  • #2
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hello i would suggest looking to use .submit; so documen.getElementById("thefirstform").submit; I would not add seperate hidden buttons though unless if you have a specific reason for adding them.

  • #3
    New to the CF scene
    Join Date
    May 2011
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hello and thanks for the Reply.

    But I need to add the code for the 6 hidden input fields and onsubmit as well

    Per the notes here is the 6 new hidden fields:


    <input type="hidden" name="onO" value="propname" />
    <input type="hidden" name="on1" value="propad" />
    <input type="hidden" name="on2" value="propowner" />
    <input type="hidden" name="osO" value="" />
    <input type="hidden" name="os1" value="" />
    <input type="hidden" name="os2" value="" />

    Here is the code for the button so far.

    This is where we need to add the above inputs as well as additional Java to copy into the input. What code do I use here ?

    <td class="DirectoryList"><form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.amt2.value=String(Number(Number(this.amt1.value)*0.038).toFixed(2));">
    <div align="center">
    <input type="hidden" name="business" value="myname@hoacommunity.com" />
    <input type="hidden" name="cmd" value="_cart" />
    <input type="hidden" name="upload" value="1" />
    <input type="hidden" name="item_name_1" value="Single month HOA payment" />
    <font size="2">Amount to pay: $</font>
    <input type="text" name="amount_1" size="8" id="amt1" />
    <br />
    <input type="hidden" name="item_name_2" value="Administrative processing fee" />
    <input type="hidden" name="amount_2" value="" id="amt2" />
    <input name="submit" type="submit" value="Pay Now" />
    <input type="hidden" name="return" value="http://www.hoacommunitymgt.com/thankyou.html" />
    <input type="hidden" name="cancel_return" value="http://www.hoacommunitymgt.com/cancel.html" />
    </div>
    </form></td>

    Any help ??

  • #4
    New to the CF scene
    Join Date
    May 2011
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Any help out there ??

  • #5
    New Coder
    Join Date
    May 2011
    Posts
    27
    Thanks
    0
    Thanked 1 Time in 1 Post
    could you not hide them with css and let the form submit as usual?


  •  

    Posting Permissions

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