jquery

Paypal Donation form with jQuery love

Submitted by matthew on March 30, 2010 - 12:36pm

I needed a donation form that would make it easy for users to select between a subscription or a one time donation. With a little jQuery love the magic happens.

First we include jquery and the jquery validate plugin. Then we setup a radio box to select between subscription and one time donation.

After the validation is successfull when the form is submitted, post the data via ajax to a php script which will enter the data in our local database. Then we return true and submit the form which will send the data to paypal. Here are all the scripts.

Javascript:
I needed a donation form that would make it easy for users to select between a subscription or a one time donation. With a little jQuery love the magic happens.

First we include jquery and the jquery validate plugin. Then we setup a radio box to select between subscription and one time donation.

After the validation is successfull when the form is submitted, post the data via ajax to a php script which will enter the data in our local database. Then we return true and submit the form which will send the data to paypal. Here are all the scripts.

Javascript:

$(document).ready(function(){
$('#amountDiv').hide();
$('input:radio[name=giftType]').click(function() {
if ($(this).attr("id")==='chooseMonthly') {

What is Drupal?

Drupal - a completely free, open source content management system that many organizations are using today to provide for their needs. Drupal's many features and add-ons allow it to be used for a variety of website needs. Drupal is a good choice for today's organizations of any size because it is free, easy, and incredibly flexible.

Syndicate content
Copyright © mrconnerton.com, 2008-2010. All Rights Reserved Drupal theme by Kiwi Themes.