1window.jQuery(document).ready(function() { 2 var $ = window.jQuery; 3 4 function validateCupoLegitimation() { 5 var creditCardPrefix = $('#cupo_registration_form_credit_card_prefix').val(); 6 7 if ( 8 creditCardPrefix.length === 0 9 || (creditCardPrefix.length === 6 && /^\d+$/.test(creditCardPrefix) === true) 10 ) { 11 $('#credit_card_prefix').removeClass('invalid'); 12 } else { 13 $('#credit_card_prefix').addClass('invalid'); 14 } 15 16 if ( 17 creditCardPrefix.length > 0 18 || $('#cupo_registration_form_credit_card_expiry_month').val().length > 0 19 || $('#cupo_registration_form_credit_card_expiry_year').val().length > 0 20 ) { 21 $('#cupo_registration_form_credit_card_prefix').prop('required', true); 22 $('#cupo_registration_form_credit_card_expiry_month').prop('required', true); 23 $('#cupo_registration_form_credit_card_expiry_year').prop('required', true); 24 } else { 25 $('#cupo_registration_form_credit_card_prefix').prop('required', false); 26 $('#cupo_registration_form_credit_card_expiry_month').prop('required', false); 27 $('#cupo_registration_form_credit_card_expiry_year').prop('required', false); 28 } 29 } 30 31 $('#cupo_registration_form_credit_card_prefix').on('keyup', function() { 32 validateCupoLegitimation(); 33 }); 34 35 $('#cupo_registration_form_credit_card_expiry_month, #cupo_registration_form_credit_card_expiry_year').on('change', function() { 36 validateCupoLegitimation(); 37 }); 38});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.