Created
October 3, 2014 22:51
-
-
Save cmc333333/ccfe387e1923779eeedf to your computer and use it in GitHub Desktop.
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
| 'use strict'; | |
| // Namespace | |
| var Init = { | |
| // State/Zip are only marked "required" if country == USA | |
| countryRequirements: function() { | |
| var country = $('#id_country'), | |
| countryReqLabels = $('label[for=id_state], label[for=id_zip_code]'); | |
| country.change(function() { | |
| if (country.val() === 'USA') { | |
| countryReqLabels.addClass('required'); | |
| } else { | |
| countryReqLabels.removeClass('required'); | |
| } | |
| }); | |
| }, | |
| // Donations in dedication to someone have additional fields | |
| dedicationFields: function() { | |
| var dedication = $('#id_dedication'), | |
| dedicationDiv = $('#dedication_details'); | |
| } | |
| }; | |
| $(document).ready(function() { | |
| Init.countryRequirements(); | |
| Init.dedicationFields(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment