How to disable a field based on the number of answers?

  • pvallet
    Asked on March 2, 2016 at 4:28 PM

    I would like to create a form with multiple products. Each product can be selected 3 times.

    I would need my user to go on the page and they should be able to select one and only one product BUT once a product has been selected already 3 times by other users who would have filled the form, they cannot be selected anymore so they need to select an other one.

    Is it possible to create this kind of form?

  • Kevin Support Team Lead
    Replied on March 2, 2016 at 6:23 PM

    Take a look on this widget, it could help you to achieve what you need: http://widgets.jotform.com/widget/gift_registry

    Currently it is not possible to do it, if the widget above does not help, you will need to get the source code of your form and add some Javascript codes to disable the option, this guide will help you to get the source code of your form: http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form. 

    You will also need to save the submitted data in your own database in order to be able to handle it with the Javascript code, this guide will help you to send the data to your database: http://www.jotform.com/help/126-How-to-send-Submissions-to-Your-MySQL-Database-Using-PHP

    Hope this helps.