Last active
August 29, 2015 14:01
-
-
Save salsalabs/0a5a9b544d8836b3fe83 to your computer and use it in GitHub Desktop.
Script to make the Donation_Designation field required in a donation page. The Donation_Designation field is usually optional, but there are some use cases, particularly when the field is a dropdown, where it needs to be required.
This file contains 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
<script type="text/javascript"> | |
$(document).ready(function() { | |
var required = $('*[name=required]'); | |
var val = required.val(); | |
if (val.indexOf('Designation_Code') == -1) { | |
val = val + "Designation_Code,"; | |
required.val(val); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment