Created
April 2, 2015 03:18
-
-
Save blooski/6bd6d29e4e6dca78cb89 to your computer and use it in GitHub Desktop.
Two different form actions depending of radio button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
var form = $('form[name="pledgeform"]'), | |
radio = $('input[name="pledge"]'), | |
choice = ''; | |
radio.change(function(e) { | |
choice = this.value; | |
if (choice === 'yes') { | |
form.attr('action', 'payment.php'); | |
} else { | |
form.attr('action', 'flat_payment.php'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment