What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    How can I limit the quantity that is ordered?

    Asked by LVHPatEd on February 15, 2011 at 01:57 PM

    We are using Jot form at our hospital to allow medical units to submit orders for booklets that my department supplies to the hospital.  We would like to cap the orders at 50 so that we are getting smaller manageable orders rather then large orders.  When I set up the order form I used the text field to list all the materials, and it was nice that it gave me a little box for them to put the number in.  

    I seen that I can limit the number of characters in the field by adjusting the preferences and validate the field to numeric.  I am wondering if I can limit it so that the number ordered can not exceed 50.  Should I have choose another type of field and if so which or can this be accomplished with the way I built the forms?

    I have pasted my master form below.


  • Profile Image
    JotForm Support

    Answered by abajan on February 15, 2011 at 07:34 PM

    I'm pretty sure there's a way to accomplish that with JavaScript but presently, if you want to go the WYSIWYG way, it is not possible to do that with your form. It would certainly be a good feature. However, (and I realize this will be a very laborious task for such a large form but copying & pasting will cut down considerably on the your workload) you can still achieve the desired result by replacing the text boxes with drop downs. In each drop down, enter the numbers 1 to 50 (with each number on a new line). That's a surefire way to prevent anyone (except a hacker, of course) from entering more than 50.

  • Profile Image

    Answered by LVHPatEd on February 16, 2011 at 02:54 PM

    Where would I insert the javascript code ?

    If I wanted the 50 max limit to apply to all my items listed on the form?

  • Profile Image
    JotForm Founder

    Answered by aytekin on February 18, 2011 at 08:35 AM

    You can get the full form source code and add the javascript code anywhere on the code. However, this code would require good knowledge of JavaScript. You should probably hire someone if you do not have any experience with it. 

    Here is how you can get full form source code. Open your form on the Form Builder:

    1. Open "Setup & Share" tab on toolbar,

    2. Click on "Embed Code"

    3. Click on "Source" button and copy it to your web site.

  • Profile Image
    JotForm Support

    Answered by abajan on February 18, 2011 at 08:49 AM

    LVHPatED, I actually found a link that would accomplish the result you desire but it's akin to using a Tank (no pun intended, Aytekin!) to kill a roach when bug spray would work just as effectively.