Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5937421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:32:21+00:00 2026-05-22T15:32:21+00:00

I have a page using Paypal Payments Standard with buy one now buttons on

  • 0

I have a page using Paypal Payments Standard with “buy one now” buttons on many products such as this.

<form id="form1" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="image" name="submit2" align="right" src="https://www.paypal.com//en_US/i/btn/sc-but-03.gif" alt="Make payments with PayPal - it's fast, free and secure!" />
    <input type="hidden" name="cmd" value="_cart" />
    <input type="hidden" name="business" value="email@gmail.com" />
    <input type="hidden" name="no_note" value="1" />
    <input type="hidden" name="add" value="1" />
    <input type="hidden" name="lc" value="US" />
    <input type="hidden" name="return" value="http://domain.com/confirm.html" />
    <input type="hidden" name="cancel_return" value="http://domain.com" />
    <input type="hidden" name="currency_code" value="USD" />
    <input type="hidden" name="bn" value="PP-ShopCartBF" />
    <input type="hidden" name="amount" value="5.00" />

    <input type="hidden" name="item_name" value="A009" />
</form>

The above code is repeated down the page for each product where only the form id’s and product numbers are changed. In this case, all products are the same price.

Before jQuery, I would just put all the repetitive parts within an SSI.

However, now I’m learning jQuery and I’d like to reduce this all to a text link instead of the PayPal button and embed the product number within the link. This link would not be between any form tags if possible.

<a class="cartBuy" href="#" id="A009">Add to Cart</a>

I know I can select my links like this…

$('.cartBuy a[id]')

But now I’m a little lost. How can I use jQuery to submit this form? Will I still need to surround my link with form tags? The whole point of this is so that I don’t have to have a unique form for every single product… just a single link for each product and let one script construct something that gets submitted (via ajax?). I looked at the jQuery Form Plugin but I’m lost with this too as it looks like I’d still need to have every item inside a unique form element. I also looked at having jQuery write all the HTML for each form but that’s not really much different than what I was doing before with SSI.

(These are “buy one now” links so there is no need to keep track of multiple selections… simply want to submit each one at a time.)

Thank-you!


ANSWER:

I used the Answer below by Josh Leitzel.

  1. I included one form element on the page which contained all the hidden input elements common to everything.

  2. I totally removed the submit button from the form since it’s not needed.

  3. I added a hidden input element to the one form for the item_name with a blank value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:32:22+00:00Added an answer on May 22, 2026 at 3:32 pm

    The way you would do this would be to select the reference ID from the link when it’s clicked, write it to the appropriate form input, and then submit the form:

    $('.cartBuy a').click(function(){
        var id = $(this).attr('id'); // gets the item name from the link's id
        $('#form1 input[name=item_name]').val(id); // writes the item name to the form field
        $('#form1').submit(); // submits the form
    
        return false; // prevents the link from being followed
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Website Payments Standard on PayPal. So I have a custom purchase page
I'm trying to get this form to initiate a donation using PayPal Payments Standard...
I have one page using this function to check if one file is on
I'm using the basic PayPal shopping cart (Website Payments Standard). I have the following
I have one page website only using HTML, CSS and JavaScript. I want to
I have a page that is using jQuery tabs. Within one of my tabs
I have overriden lead object standard detail page with my vf page using tag
I have this code that fetches some text from a page using BeautifulSoup soup=
I am using PayPal Website Payments Standard in my magento based e-commerce site. At
I am currently using PayPal's Website Payments Standard to accept credit cards on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.