Skip to content

Instantly share code, notes, and snippets.

View AlexRiina's full-sized avatar

Alex Riina AlexRiina

View GitHub Profile
// jQuery Plugin (Change Type)
(function ($) {
$.fn.cryptForm = function (key, toCryptSel) {
var form = $(this);
var braintree = Braintree.create(key);
form.submit(function () {
form.find(toCryptSel).each(function () {
this.type = 'password';
$(this).val(braintree.encrypt($(this).val()));