Signin  Pricing  Examples  Support

Libraries > jscript_ccard.js

jscript_ccard.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://pandora--charms.in.net/includes/templates/wash/jscript/jscript_ccard.js

Function Explorer



Libraries on pandora--charms.in.net


jscript_builder.js

jscript_ccard.js

jscript_controls.js

jscript_cookies.js

jscript_dragdrop.js

jscript_effects.js

jscript_form.js

jscript_func.js

jscript_jquery.easing.1.3.min.js

jscript_jquery.jqtransform.js

jscript_jquery-min.js

jscript_jquery.touchcarousel-1.0.min.js

jscript_js.js

jscript_menu.js

jscript_prototype.js

jscript_royal-slider-8.1.min.js

jscript_script.js

jscript_slider.js

jscript_translate.js

jscript_validation.js

jscript_zjxied.js



Explore More


js_u42AlFiBVWvO7IjubpJL6NboUQtp7K7ToNBIaGRq_R0.js

js_ZieIo3o88LFs_Xync0uEiSpVfeAdo6d_AnLFZDZZypY.js

eucookie.js.pagespeed.jm.JdNp2nsYY7.js

textsizer.js

jscript_ccard.js
				
// Credit Card Validation Javascript
// copyright 12th May 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function validateCreditCard(s) {
    // remove non-numerics
    var v = "0123456789";
    var w = "";
    for (i=0; i < s.length; i++) {
        x = s.charAt(i);
        if (v.indexOf(x,0) != -1)
        w += x;
    }
    // validate number
    j = w.length / 2;
    k = Math.floor(j);
    m = Math.ceil(j) - k;
    c = 0;
    for (i=0; i<k; i++) {
        a = w.charAt(i*2+m) * 2;
        c += a > 9 ? Math.floor(a/10 + a%10) : a;
    }
    for (i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
    return (c%10 == 0);
}



A B C D E F G H I J K L M N O P Q R S T U V W X Y Z