Custom Code
  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #411804
    Guy Amilani
    Guest

    Hi, excellent plugin, very useful,

    But I’m trying to understand how to use the custom code, I need to validate Israeli ID number, and I have the jQuery code but I can’t find any documentation on how to do it.
    <script>
    function is_israeli_id_number(id) {
    id = String(id).trim();
    if (id.length > 9 || isNaN(id)) return false;
    id = id.length < 9 ? (“00000000” + id).slice(-9) : id;
    return Array.from(id, Number).reduce((counter, digit, i) => {
    const step = digit * ((i % 2) + 1);
    return counter + (step > 9 ? step – 9 : step);
    }) % 10 === 0;
    }

    </script>

    Thank You,
    Guy

Viewing 1 post (of 1 total)
  • The topic ‘Custom Code’ is closed to new replies.