function requestCardNonce(event) { $res=false; event = event || window.event; jQuery.ajax({ url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=validateform', async: false, type: 'POST', data: { 'data' : jQuery('#mgvform').serialize() }, }).then(function (data){ debugger; jQuery('#mgvform input').css('outline','none'); jQuery('#mgvform .two-thirds').find('span[name=errorspan]').remove(); jQuery('#mgvform').find('span[name=errorspan]').remove(); jQuery('#mgvform [name=txttermesconditions]').parent().css('outline', 'none'); jQuery('#mgvform').find('.select2-container').css('outline', 'none'); if (Object.keys(data).length > 0) {
jQuery.each(data, function (index, element) { switch (index) { case 'txttermesconditions': jQuery('#mgvform [name=txttermesconditions]').parent().css('outline', '1px solid red'); break; case 'txtmethodepaiement': jQuery('#mgvform [name=txtmethodepaiement]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtmethodepaiement]').parent().append('' + element + ''); break; case 'txtpays': jQuery('#mgvform [name=txtpays]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtpays]').parent().append('' + element + ''); break; case 'txtprovince': jQuery('#mgvform [name=txtprovince]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtprovince]').parent().append('' + element + ''); break; case 'txtville': jQuery('#mgvform [name=txtville]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtville]').parent().append('' + element + ''); break; case 'txttypeentreprise': jQuery('#mgvform [name=txttypeentreprise]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txttxttypeentrepriseville]').parent().append('' + element + ''); break; case 'txtsexe': jQuery('#mgvform [name=txtsexe]').parent().find('.select2-container').css('outline', '1px solid red'); break; case 'txtlangue_communication': jQuery('#mgvform [name=txtlangue_communication]').parent().find('.select2-container').css('outline', '1px solid red'); break;
case 'txtreference': jQuery('#mgvform [name=txtreference]').parent().find('.select2-container').css('outline', '1px solid red'); break;
case 'txtentreprisepays': jQuery('#mgvform [name=txtentreprisepays]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtentreprisepays]').parent().append('' + element + ''); break; case 'txtentrepriseprovince': jQuery('#mgvform [name=txtentrepriseprovince]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtentrepriseprovince]').parent().append('' + element + ''); break; case 'txtentrepriseville': jQuery('#mgvform [name=txtentrepriseville]').parent().find('.select2-container').css('outline', '1px solid red'); jQuery('#mgvform [name=txtentrepriseville]').parent().append('' + element + ''); break;
default: jQuery('#mgvform [name=' + index + ']').css('outline', '1px solid red'); jQuery('#mgvform [name=' + index + ']').parent().append('' + element + ''); break; } }) $res= false; } else { $res= true; } })
if ($res === false) { event.preventDefault(); return false; } // Don't submit the form until SqPaymentForm returns with a nonce event.preventDefault(); txtmethodepaiement = document.getElementsByName('txtmethodepaiement'); if (txtmethodepaiement.length>0) { if (txtmethodepaiement[0].value === '3091a936-4f22-eab9-5789-2a1e113127ff') { // Request a nonce from the SqPaymentForm object paymentForm.requestCardNonce(event); } else { $input = jQuery(''); jQuery('#mgvform').append($input); document.getElementById('mgvform').submit(); }
} // return false;
}
jQuery(document).ready(function ($) {
// Set the application ID var applicationId = "sq0idp-Jm91zT4q41jwWMV_MAmNrg";
// Set the location ID var locationId = "D95B2YMCB5NFK";
// Create and initialize a payment form object paymentForm = new SqPaymentForm({ autoBuild: false, paymentFormLoaded: function () { /* HANDLE AS DESIRED */ console.log("The form loaded!"); }, // Initialize the payment form elements applicationId: applicationId, locationId: locationId, inputClass: 'sq-input',
// Customize the CSS for SqPaymentForm iframe elements inputStyles: [{ fontSize: '18px', fontFamily: 'Helvetica Neue', padding: '6px', color: '#373F4A', lineHeight: '16px', placeholderColor: '#BDBFBF',
}], applePay: false, masterpass: false, googlePay: false,
// Initialize the credit card placeholders cardNumber: { elementId: 'sq-card-number', placeholder: '•••• •••• •••• ••••' }, cvv: { elementId: 'sq-cvv', placeholder: 'CVV' }, expirationDate: { elementId: 'sq-expiration-date', placeholder: 'MM/YY' }, postalCode: { elementId: 'sq-postal-code' },
// SqPaymentForm callback functions callbacks: {
cardNonceResponseReceived: function(errors, nonce, cardData, billingContact, shippingContact) {
if (errors) { // Log errors from nonce generation to the Javascript console console.log("Encountered errors:"); errors.forEach(function (error) { console.log(' ' + error.message); });
return false; }
$input2 = jQuery(''); jQuery('#mgvform').append($input2);
$input = jQuery(''); jQuery('#mgvform').append($input); console.log('Nonce received: ' + nonce);
document.getElementById('mgvform').submit();
},
} });
if (SqPaymentForm.isSupportedBrowser()) { paymentForm.build(); paymentForm.recalculateSize(); }
jQuery('label').click(function (e) { e.preventDefault();
attr_for = jQuery(this).attr('for'); jQuery("[name="+attr_for+"]").focus(); });
jQuery('#mgvform [name=div-soutien-minimum]').hide(); jQuery('#mgvform [name=div-soutien-full]').hide(); jQuery('#mgvform [name=div-entreprise-minimum]').hide(); jQuery('#mgvform [name=div-entreprise-full]').hide(); jQuery('#mgvform [name=div-bouton]').hide(); jQuery('#mgvform [name=div-cheque]').hide(); jQuery('#mgvform [name=div-argent]').hide(); jQuery('#mgvform [name=div-creditcard]').hide();
//jQuery('#mgvform// [name=txtdate_naissance]').datepicker({ // dateFormat: "yy-mm-dd", // showButtonPanel: true, // changeMonth: true, // changeYear: true, // // showOn: "focus", // minDate: '-120Y', // maxDate: '-16Y', // yearRange: '1900:2199', // beforeShow: function () { // setTimeout( // function () { // a = parseInt(jQuery('#ui-datepicker-div').css('top')); // jQuery('#ui-datepicker-div') // .css('top', (a + 0) + 'px') // .ampm_maxZIndex({inc: 1}); // ; // }, 200 // ) // // }, //}); jQuery('#mgvform [name=txtdate_naissance]').Zebra_DatePicker({ view: 'years', first_day_of_week: 0, direction: -5844, zero_pad: true, //container : jQuery('#mgvform//'), }); jQuery('input[name=txtinfoadditionnel]').checkboxpicker({ offClass: 'btn-danger', onClass: 'btn-success', offLabel: 'Non ', onLabel: 'Oui ', }); $txtprenom = jQuery('#mgvform [name=txtprenom]'); $txtnom = jQuery('#mgvform [name=txtnom]'); $txtdate_naissance = jQuery('#mgvform [name=txtdate_naissance]'); $txtcourriel = jQuery('#mgvform [name=txtcourriel]');
$txtreference = jQuery('#mgvform [name=txtreference]').select2({}); $txtmethodepaiement = jQuery('#mgvform [name=txtmethodepaiement]').select2({}); $txtsexe = jQuery('#mgvform [name=txtsexe]').select2({}); $txtlangue_communication = jQuery('#mgvform [name=txtlangue_communication]').select2({}); $txtinputcheckbox= jQuery('#mgvform input[type=checkbox]'); $txtinputrequis = jQuery('#mgvform .txtinputrequis'); $txttype_membre = jQuery('#mgvform [name=txttype_membre]').select2({}); $txttypeentreprise = jQuery('#mgvform [name=txttypeentreprise]').select2({}); $txtpayera = jQuery('#mgvform [name=txtpayera]'); jQuery.ajaxSetup({ cache: true });
$select2_pays_options = { placeholder: "Sélectionner un pays", delay: 100, minimumInputLength: 1, language: 'fr', ajax: { type: "POST", cache: true, async: false, // url: 'https://geonames-api.ampm-info.com/getCountriesJSON', url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getPays', //url: '//?action=getPays', dataType: 'json', data: function(params) { var xxx= { term: params.term, } return xxx; },
processResults: function (data) { return { results: data
}; } },
}; select2_province_options = { placeholder: "Sélectionner un(e) province/état/région", delay: 100, minimumInputLength: 0, language: 'fr', ajax: { type: "POST", cache: true, async: false, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getStates', //url: '//?action=getStates', data: function (params) {
var xxx= { term: params.term, country_geonameid: jQuery('#mgvform [name=txtpays]').val() } return xxx; }, dataType: 'json',
processResults: function (data) { return { results: data
}; } }, }; select2_ville_options = { placeholder: "Sélectionner une ville", delay: 100, minimumInputLength: 1, language: 'fr', ajax: { type: "POST", cache: false, async: false, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getCities', //url: '//?action=getCities', data: function(params) { var xxx= { state_geonameid : jQuery('#mgvform [name=txtprovince]').val(), term: params.term, }; return xxx; }, dataType: 'json', containerCssClass: "custom-dropdown",
processResults: function (data) {
$a = []; jQuery.each(data, function(index, value) {
$arr = []; $arr['id'] = value.id; $arr['text'] = value.text; $a.push($arr); }); return { results: $a
}; } }, };
$select2_pays_options_entreprise = { placeholder: "Sélectionner un pays", delay: 100, minimumInputLength: 1, language: 'fr', ajax: { type: "POST", cache: true, async: false, // url: 'https://geonames-api.ampm-info.com/getCountriesJSON', url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getPays', //url: '//?action=getPays', dataType: 'json', data: function(params) { var xxx= { term: params.term, } return xxx; },
processResults: function (data) { return { results: data
}; } },
}; select2_province_options_entreprise = { placeholder: "Sélectionner un(e) province/état/région", delay: 100, minimumInputLength: 0, language: 'fr', ajax: { type: "POST", cache: true, async: false, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getStates', //url: '//?action=getStates', data: function (params) {
var xxx= { term: params.term, country_geonameid: jQuery('#mgvform [name=txtentreprisepays]').val() } return xxx; }, dataType: 'json',
processResults: function (data) { return { results: data
}; } }, }; select2_ville_options_entreprise = { placeholder: "Sélectionner une ville", delay: 100, minimumInputLength: 1, language: 'fr', ajax: { type: "POST", cache: false, async: false, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getCities', //url: '//?action=getCities', data: function(params) { var xxx= { state_geonameid : jQuery('#mgvform [name=txtentrepriseprovince]').val(), term: params.term, }; return xxx; }, dataType: 'json', containerCssClass: "custom-dropdown",
processResults: function (data) {
$a = []; jQuery.each(data, function(index, value) {
$arr = []; $arr['id'] = value.id; $arr['text'] = value.text; $a.push($arr); }); return { results: $a
}; } }, };
$txtpays = jQuery('#mgvform [name=txtpays]').select2($select2_pays_options); $txtprovince = jQuery('#mgvform [name=txtprovince]').select2(select2_province_options); $txtville = jQuery('#mgvform [name=txtville]').select2(select2_ville_options);
$txtentreprisepays = jQuery('#mgvform [name=txtentreprisepays]').select2($select2_pays_options_entreprise); $txtentrepriseprovince = jQuery('#mgvform [name=txtentrepriseprovince]').select2(select2_province_options_entreprise); $txtentrepriseville = jQuery('#mgvform [name=txtentrepriseville]').select2(select2_ville_options_entreprise);
// Set country to CA as default jQuery.ajax({ type: 'GET', async: false, dataType: 'json', cache: true, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getPays&default=1' }).then(function (data2) { // create the option and append to Select2
var option = new Option(data2.text, data2.id, true, true); $txtpays.append(option).trigger('change');
// manually trigger the `select2:select` event $txtpays.trigger({ type: 'select2:select', params: { data: data2 } }); data = $txtpays.val(); if (data === '6251999') { // CANADA jQuery("#mgvform input[name=txtcodepostal]").mask("w0W 0W0",{ translation: { 'W': {pattern: /[ABCEGHJKLMNPRSTVWXYZ]/, optional: false, uppercase: true}, 'w': {pattern: /[ABCEGHJKLMNPRSTVXY]/, optional: false, uppercase: true} } }); jQuery("#mgvform input[name=txttelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txttelephone2]").mask("(000) 000-0000"); } else if (data === '6252001') { // UNITED STATES jQuery("#mgvform input[name=txtcodepostal]").unmask(); jQuery("#mgvform input[name=txttelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txttelephone2]").mask("(000) 000-0000"); } else { jQuery("#mgvform input[name=txtcodepostal]").unmask(); jQuery("#mgvform input[name=txttelephone]").unmask(); jQuery("#mgvform input[name=txttelephone2]").unmask(); }; $txtpays.trigger('change'); });
jQuery.ajax({ type: 'GET', async: false, dataType: 'json', cache: true, url: 'https://mgv.coop/wp-admin/admin-ajax.php?action=getPays&default=1' }).then(function (data2) { // create the option and append to Select2
var option = new Option(data2.text, data2.id, true, true); $txtentreprisepays.append(option).trigger('change');
// manually trigger the `select2:select` event $txtentreprisepays.trigger({ type: 'select2:select', params: { data: data2 } }); data = $txtentreprisepays.val(); if (data === '6251999') { // CANADA jQuery("#mgvform input[name=txtentreprisecodepostal]").mask("w0W 0W0",{ translation: { 'W': {pattern: /[ABCEGHJKLMNPRSTVWXYZ]/, optional: false, uppercase: true}, 'w': {pattern: /[ABCEGHJKLMNPRSTVXY]/, optional: false, uppercase: true} } }); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else if (data === '6252001') { // UNITED STATES jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else { jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone2]").unmask(); }; $txtentreprisepays.trigger('change'); });
$txtpays.on('select2:select',function (e) { var data = jQuery(this).val();
if (data === '6251999') { // CANADA jQuery("#mgvform input[name=txtcodepostal]").mask("w0W 0W0",{ translation: { 'W': {pattern: /[ABCEGHJKLMNPRSTVWXYZ]/, optional: false, uppercase: true}, 'w': {pattern: /[ABCEGHJKLMNPRSTVXY]/, optional: false, uppercase: true} } }); jQuery("#mgvform input[name=txttelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txttelephone2]").mask("(000) 000-0000"); } else if (data === '6252001') { // UNITED STATES jQuery("#mgvform input[name=txtcodepostal]").unmask(); jQuery("#mgvform input[name=txttelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txttelephone2]").mask("(000) 000-0000"); } else { jQuery("#mgvform input[name=txtcodepostal]").unmask(); jQuery("#mgvform input[name=txttelephone]").unmask(); jQuery("#mgvform input[name=txttelephone2]").unmask(); }; $txtville.empty(); $txtprovince.empty(); $txtville.trigger('change'); $txtprovince.trigger('change'); $opt = $.extend(true,select2_province_options, { ajax: { data: function (params){ return { country_geonameid : jQuery('#mgvform [name=txtpays]').val(), term: params.term, } } } }); $txtprovince.select2($opt); $txtprovince.trigger('change'); }); $txtprovince.on('select2:select',function (e) { var data = jQuery(this).val();
$txtville.empty(); $txtville.trigger('change');
$opt = $.extend(true, select2_ville_options, { ajax: { data: function (params) { return { state_geonameid: jQuery('#mgvform [name=txtprovince]').val(), term: params.term, } } } });
$txtville.select2($opt); $txtville.trigger('change'); });
$txtentreprisepays.on('select2:select',function (e) { var data = jQuery(this).val();
if (data === '6251999') { // CANADA jQuery("#mgvform input[name=txtentreprisecodepostal]").mask("w0W 0W0",{ translation: { 'W': {pattern: /[ABCEGHJKLMNPRSTVWXYZ]/, optional: false, uppercase: true}, 'w': {pattern: /[ABCEGHJKLMNPRSTVXY]/, optional: false, uppercase: true} } }); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else if (data === '6252001') { // UNITED STATES jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else { jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone2]").unmask(); }; $txtentrepriseville.empty(); $txtentrepriseprovince.empty(); $txtentrepriseville.trigger('change'); $txtentrepriseprovince.trigger('change'); $opt = $.extend(true,select2_province_options, { ajax: { data: function (params){ return { country_geonameid : jQuery('#mgvform [name=txtentreprisepays]').val(), term: params.term, } } } }); $txtentrepriseprovince.select2($opt); $txtentrepriseprovince.trigger('change'); }); $txtentrepriseprovince.on('select2:select',function (e) { var data = jQuery(this).val();
$txtentrepriseville.empty(); $txtentrepriseville.trigger('change');
$opt = $.extend(true, select2_ville_options, { ajax: { data: function (params) { return { state_geonameid: jQuery('#mgvform [name=txtentrepriseprovince]').val(), term: params.term, } } } });
$txtentrepriseville.select2($opt); $txtentrepriseville.trigger('change'); });
$txtnomentreprise = jQuery('#mgvform [name=txtnomentreprise]'); $txtnoentreprise = jQuery('#mgvform [name=txtnoentreprise]'); $txtentrepriseprenom = jQuery('#mgvform [name=txtentrepriseprenom]'); $txtentreprisenom = jQuery('#mgvform [name=txtentreprisenom]'); $txtentreprisecourriel = jQuery('#mgvform [name=txtentreprisecourriel]');
$txtmethodepaiement.on('select2:select', function(e) {
if ($txtmethodepaiement.val() === '3091a936-4f22-eab9-5789-2a1e113127ff') { // CREDIT CARD jQuery('#mgvform [name=div-cheque]').hide(); jQuery('#mgvform [name=div-argent]').hide(); jQuery('#mgvform [name=div-creditcard]').slideDown(); // SqPaymentForm.recalculateSize();
} else if ($txtmethodepaiement.val() === '3091a936-4f22-eab9-5789-2a1e113127fe') { // CHEQUE jQuery('#mgvform [name=div-creditcard]').hide(); jQuery('#mgvform [name=div-argent]').hide(); jQuery('#mgvform [name=div-cheque]').slideDown(); } else if ($txtmethodepaiement.val() === '303f1d1e-29e6-5554-e85c-e240921d371f') { // ARGENT jQuery('#mgvform [name=div-creditcard]').hide(); jQuery('#mgvform [name=div-cheque]').hide(); jQuery('#mgvform [name=div-argent]').slideDown();
} else { // AUTRES jQuery('#mgvform [name=div-argent]').hide(); jQuery('#mgvform [name=div-cheque]').slideUp(); jQuery('#mgvform [name=div-creditcard]').slideUp(); }
}); $txtinputcheckbox.on('select2:select',function (e) { var data = jQuery(this).val();
if (data === '6251999') { // CANADA jQuery("#mgvform input[name=txtentreprisecodepostal]").mask("w0W 0W0",{ translation: { 'W': {pattern: /[ABCEGHJKLMNPRSTVWXYZ]/, optional: false, uppercase: true}, 'w': {pattern: /[ABCEGHJKLMNPRSTVXY]/, optional: false, uppercase: true} } }); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else if (data === '6252001') { // UNITED STATES jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").mask("(000) 000-0000"); jQuery("#mgvform input[name=txtentreprisetelephone2]").mask("(000) 000-0000"); } else { jQuery("#mgvform input[name=txtentreprisecodepostal]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone]").unmask(); jQuery("#mgvform input[name=txtentreprisetelephone2]").unmask(); }; $txtville.empty(); $txtprovince.empty(); $txtville.trigger('change'); $txtprovince.trigger('change'); $opt = $.extend(true,select2_province_options, { ajax: { data: function (params){ return { country_geonameid : jQuery('#mgvform [name=txtentreprisepays]').val(), term: params.term, } } } }); $txtprovince.select2($opt); $txtprovince.trigger('change');
});
$txttype_membre.on('select2:select', function(e){ var data = e.params.data;
if (data.id === 'dfcec625-cfe7-bd57-7737-38713713425c') {
jQuery('#mgvform [name=div-soutien-full]').hide(); jQuery('#mgvform [name=txttextmontant]').html('$20'); jQuery('#mgvform [name=div-soutien-minimum]').fadeIn(); jQuery('#mgvform [name=div-entreprise-minimum]').hide(); jQuery('#mgvform [name=div-entreprise-full]').hide(); jQuery('#mgvform [name=div-bouton]').fadeIn();
if(jQuery('#mgvform [name=txtinfoadditionnel]').is(":checked")) { jQuery('#mgvform [name=div-soutien-full]').fadeIn(); } else { jQuery('#mgvform [name=div-soutien-full]').fadeOut(); }
} else if (data.id === '5d7c1f5c-6b5b-a461-7515-8e843c8d29ea') { jQuery('#mgvform [name=txttextmontant]').html('$1000'); jQuery('#mgvform [name=div-entreprise-full]').hide(); jQuery('#mgvform [name=div-entreprise-minimum]').fadeIn(); jQuery('#mgvform [name=div-soutien-minimum]').hide(); jQuery('#mgvform [name=div-soutien-full]').hide(); jQuery('#mgvform [name=div-bouton]').fadeIn();
if(jQuery('#mgvform [name=txtinfoadditionnelentreprise]').is(":checked")) { jQuery('#mgvform [name=div-entreprise-full]').fadeIn(); } else { jQuery('#mgvform [name=div-entreprise-full]').fadeOut(); } } });
$txtinfoadditionnel = jQuery('#mgvform [name=txtinfoadditionnel]'); $txtinfoadditionnel.change(function () { if(jQuery(this).is(":checked")) { jQuery('#mgvform [name=div-soutien-full]').fadeIn(); } else { jQuery('#mgvform [name=div-soutien-full]').fadeOut(); } });
$txtinfoadditionnelentreprise = jQuery('#mgvform [name=txtinfoadditionnelentreprise]'); $txtinfoadditionnelentreprise.change(function () { if($(this).is(":checked")) { jQuery('#mgvform [name=div-entreprise-full]').fadeIn(); } else { jQuery('#mgvform [name=div-entreprise-full]').fadeOut(); } }); $btnsmt = jQuery('#mgvform [name=btnsmt]'); //$btnsmt.click(function(e) { // e.stopPropagation(); // // if ($txtmethodepaiement.val() === '3091a936-4f22-eab9-5789-2a1e113127ff') { // CREDIT CARD // requestCardNonce(e); // } // $input = jQuery(''); // jQuery('#mgvform//').append($input); // jQuery('#mgvform//').submit(); // // //}) })