Last active
October 6, 2015 06:27
-
-
Save Tetsuro/2950334 to your computer and use it in GitHub Desktop.
jQuery for Terms and Conditions
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" charset="utf-8"> | |
//<![CDATA[ | |
// Including jQuery conditionnally. | |
if (typeof jQuery === 'undefined') { | |
document.write({{ "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" | script_tag | json }}); | |
document.write('<script type="text/javascript">jQuery.noConflict();<\/script>'); | |
} | |
//]]> | |
</script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
jQuery(".submit-cart input[type='submit'],.submit-cart input[type='image']").click(function(){ | |
if(jQuery('#agree').is(':checked')){ | |
jQuery(".submit-cart input").submit(); | |
} | |
else{ | |
alert("You must agree to the Terms and Conditions first"); | |
return false; | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment