(function($) { $(document).ready(function(){ codes_list = {"fr":{"company":"Alphatrad France","payment_form_url":"https:\/\/www.alphatrad.fr\/paiement-securise","sites":["fr"]},"es":{"company":"Alphatrad Spain","payment_form_url":"https:\/\/www.alphatrad.es\/formulario-de-pago","sites":["es","cat"]},"de":{"company":"Alphatrad Germany","payment_form_url":"https:\/\/www.alphatrad.de\/online-zahlung","sites":["de"]},"at":{"company":"Alphatrad Austria","payment_form_url":"https:\/\/www.alphatrad.at\/online-zahlung","sites":["at"]},"fdk":{"company":"Alphatrad Denmark","payment_form_url":"http:\/\/optilingua-oversaettelser.dk\/sikker-betaling","sites":["dk"]},"it":{"company":"Traducta Italy","payment_form_url":"https:\/\/www.traducta.it\/pagamento-sicuro-servizi-traduzioni","sites":["it"]},"lu":{"company":"Alphatrad Luxembourg","payment_form_url":"http:\/\/www.alphatrad.lu\/paiement-securise","sites":["lu"]},"nl":{"company":"Traducta Netherlands","payment_form_url":"http:\/\/traducta.nl\/veilig-betalen","sites":["nl"]},"pt":{"company":"Alphatrad Portugal","payment_form_url":"https:\/\/www.alphatrad.pt\/pagamento-seguro","sites":["pt"]},"ch":{"company":"Traducta Switzerland","payment_form_url":"https:\/\/www.traducta.ch\/online-zahlung","sites":["ch"]},"gb":{"company":"Alphatrad UK","payment_form_url":"http:\/\/www.alphatrad.co.uk\/online-payment","sites":["uk"]},"v":{"company":"ViaVerbia Belgium","payment_form_url":"https:\/\/viaverbia.be\/veilig-betalen","sites":["be","luv"]}}; remove_error_messages(); $('#check-docnum-continue').click(function(){ $('.check_errors_msg').remove(); var checkErrors = false; var condError = false; var msg = ''; if (!$("input[name=type_dossier]").is(":checked")){ $('#type_dossier_c').prepend('Document type not selected'); checkErrors = true; } if ($('#document-number-p1').val() == '' || $('#document-number-p2').val() == '') { $('#document-number-c').append('Required field'); $('#document-number').addClass('has-error'); checkErrors = true; } else { var code = $('#document-number-p1').val().toLowerCase(); var other = check_code_other(code); if(other) { // load form load_form(codes_list[code]['sites'][0], $('input[name=test]').val()); } else { // code not valid at all $('#document-number-c').append('The document number is not valid. Please check the number on your invoice or quotation.'); $('#document-number').addClass('has-error'); checkErrors = true; } } return false; }); }); })(jQuery);