EAN 13 check digit

  • MetroSerbia
    Asked on February 22, 2017 at 4:23 AM

    Is there some function we can easily use to check if entry is correct?

    customer inputs 13 digits and function check last one is it correct entry or not.

  • Support_Management Jotform Support
    Replied on February 22, 2017 at 6:33 AM

    Since we're not exactly sure what you mean, I'll just cover them all:

    1. If you mean you wanted to restrict your users to entering 13 digits only, you may either use a NUMBER FIELD then set a LIMIT ENTRY or use a TEXTBOX then setup an INPUT MASK.

    NUMBER FIELD:

    EAN 13 check digit Image 1 Screenshot 40

    Set the ENTRY LIMIT to 13 min / 13 max so no one can enter anything except 13 digits.

    TEXTBOX with INPUT MASK

    EAN 13 check digit Image 2 Screenshot 51

    Just set the INPUT MASK as ############# (which means 13 digits only)

    Related guide: Getting-Started-with-the-basics-of-Input-Masking

    2. But if you meant you wanted to further checking (e.g. check whether the 13 digit entered matches something), then you'd have to use Conditions for that. To learn more, head over to the guide I'm linking below.

    EAN 13 check digit Image 3 Screenshot 62

    Related guide: Smart-Forms-Using-Conditional-Logic 

    In case we misunderstood your question, just get back to us with a bit more info and a clearer description of what you're trying to do so we can better assist you.

  • MetroSerbia
    Replied on February 22, 2017 at 6:38 AM

    Hi,

    I'm talking about calculating check digit of barcode. Here is in more details explained

    http://www.morovia.com/education/utility/upc-ean.asp

    Some function that will make this calculations because using conditions I can not extract even/odd digits to make calculation.

     

  • Support_Management Jotform Support
    Replied on February 22, 2017 at 11:24 AM

    Thanks for the link but we can't help you with the calculation if we don't even know how your calculation works to begin with.

    Just to name a few - What are given values for the computation? What is the expected output? What are the unknowns? If you know the actual formula we can possibly tell you if it's feasible or not.

    As much as we wanted to help, we hope you understand that we can't provide you an answer unless we have a detailed explanation on how this should work.

    As a baseline guide, here are some of the things you can do with calculations

    Related guides:

    How-to-Perform-Calculation-in-the-Form

    Form-Calculation-Math-Function-Reference

  • MetroSerbia
    Replied on February 23, 2017 at 3:26 AM

    Explanation is on linked web page. But ok, this is how calculation should be done.

    So if customer input is 5449000000996 formula should get first 12 digits (544900000099) do calculation (explained below) and then compare result with 13th digit. If formula result is 6 then it is ok, if it is some other number then there is error in typing and customer must correct input.

     

    Hope that this helps a bit

     

    EAN 13 check digit Image 1 Screenshot 20

  • Support_Management Jotform Support
    Replied on February 23, 2017 at 5:26 AM

    Sorry but there's no way to achieve this with Conditions/Calculations. This would require an actual logic programmed either with Javascript (front-end) or through a back-end server (php, asp, etc.).

    The only way around this is to grab your form's Full Source code, then have your designer/developer program it based on the page you linked here.