I have two forms on a page. Each calls some javascript code. One goes to paypal and one that goes to a send mail routine. How can I distinguish between the two so they don’t obstruct with each other?
Contact form descriptor:

<form action='sendMail.php' method='post' id="contact-form" class="form-horizontal"  >
        <fieldset>
         …

Paypal form descriptor:

<div id="donationForm">
                <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
                    <input type="hidden" name="cmd" value="_s-xclick">

I hope that makes sense since it seems that my application does not know what to do when the submit button is clicked?
I was also thinking that I could name my button “submit-contact” , instead of “submit” but this does not seem to work.

Member Avatar for LastMitch

I have two forms on a page. Each calls some javascript code. One goes to paypal and one that goes to a send mail routine. How can I distinguish between the two so they don’t obstruct with each other?

There should only 1 Submit Form on the checkout sheet on a shopping cart.

You can't put 2 <form> in one page!

The contact form should be in a separate page.

When a customer press the submit button the data goes to the database and the page will redirected to the Paypal page with the data.

That is the correct way of doing it.

The only solution is try to put all the info on one form.

I found my way around the delema. Thanks!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.