SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automatic form posting

    I have made a function that will automatically create a PayPal form. It only requires PayPal_Form("name", "amount"... "weight/size") to produce the form and specific posting information to paypal.

    My difficulty is: I want to have this form implement another function called Add_Shipping that will allow me to create my own shipping definitions. The problem is, what php code do I need to know for the Add_Shipping function that.. when I click the paypal's "add to cart" form my "Add_Shipping" function can automatically send the posting variables to paypal.
    (ie. how do I get something to automatically post without having to click on a form?)

    Thank you & Aloha
    Bob

  2. #2
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try a javascript function.

    Possibly add a hidden form field in your html called <input type=hidden name="addship" value="0">

    In your Add_Shipping button, do an OnClick()=javascript:add_shipping();

    Your add_shipping function can then calculate the shipping and set the form value "addship" with document.addship.value=calculated_java_value then do a document.my_form_name.submit() lastly in the function.
    intragenesis, llc professional web & graphic design

  3. #3
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the OnClick an document.my_form_name.submit() commands. I appreciate your help.
    Aloha
    Bob

  4. #4
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, good luck, but, a final note, try to work with "universal" and complient methods of handling your html and forms. And by all means, I would avoid getting into Microsofts DOM (Document Object Model) it has some neat features, for instance, you can build a WYSIWYG content managment system, but, you'll get to the point that unless your "client" has IE installed using the DOM won't work on other browsers.
    intragenesis, llc professional web & graphic design

  5. #5
    SitePoint Wizard holmescreek's Avatar
    Join Date
    Mar 2001
    Location
    Northwest Florida
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Btw, welcome to Sitepoint, I just noticed after my post your a new member to the forums. ANd by all means, with my last post, I didn't intend to throw any confusion your way. If you understood what I was talking about then keep it, otherwise forget it.
    intragenesis, llc professional web & graphic design


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
  •