How to trigger fields after box is checked?

  • apollomedflight
    Asked on December 19, 2016 at 12:55 PM

    I am creating an order form, and I need to make it so each checked item (using check box) triggers a field for the customer to type in the quantity they want. How would I do this?

  • John_Benson
    Replied on December 19, 2016 at 2:46 PM

    If I understand you correctly, you want the user to select something in the check box and then the quantity field will appear. That is possible, you just need to create a show or hide fields condition. Here's a guide: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    I also created a demo form: https://form.jotform.com/63535671070959. You can clone it if you want and check the conditions I created. The demo contains check box field and radio button field. Here's a screen animation:

    How to trigger fields after box is checked? Image 1 Screenshot 20

    Here's a guide on: How-to-Clone-an-Existing-Form-from-a-URL.

    Hope that helps. Let us know if you encounter a problem or need further assistance. Thank you.

  • apollomedflight
    Replied on December 19, 2016 at 5:45 PM
    Is there a way to make the “quantity” box line up to the side of the option boxes?
    ...
  • David JotForm Support Manager
    Replied on December 19, 2016 at 10:08 PM

    This would required CSS coding. Do you want to show a text box for each option? Would you consider using a Purchase Order field? https://www.jotform.com/help/165-Setting-Up-Your-First-Order-Form 

    How to trigger fields after box is checked? Image 1 Screenshot 30

    If you would, you just need to inject the following code in order to place the quantity field next to the option: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes 

    .form-product-item br{

        display: none !important;

    }

    span.form-sub-label-container{

        margin: 0px;

        margin-top:-5px !important;

    }

    Result: https://www.jotformpro.com/form/63538685532970? 

    How to trigger fields after box is checked? Image 2 Screenshot 41

    Let us know if you need more help.

  • apollomedflight
    Replied on December 20, 2016 at 9:46 AM
    That purchase order form looks similar to what we are wanting, but we don’t want to link it to any payment source. We also want the quantity to be a required box if the item is checked
    ...
  • Nik_C
    Replied on December 20, 2016 at 10:25 AM

    Purchase order payment widget is not linked to any payment source. You can check it here: https://apps.jotform.com/app/purchase_order_app

    Purchase order is used to show the products with prices and quantities but without actual payment going on.

    You can not make a drop down field in Purchase order to be a required field, you can only do that with the product itself:

    How to trigger fields after box is checked? Image 1 Screenshot 20

    What you could do as an alternative is to create your products by using regular dropdown and radio button fields like my colleague John showed in his reply here.

    Please let us know if you have any further questions.

    Thank you!