Can I add some check on submit button click?

  • pargev2010
    Asked on August 7, 2020 at 2:42 PM

    can I add some check on submit button click?
    I use the Weekly Appointment Planner widget and I want to check available places during the submit button, to avoid parallel submissions

  • KrisLei Jotform Support
    Replied on August 7, 2020 at 4:26 PM

    Hi,

    "can I add some check on submit button click?"

    I have checked your form, to verify are you referring to the Review Before Submit widget? My apologies for the confusion, can you provide us with additional details with your requirements? 

    "...to avoid parallel submissions"

    If you are referring to prevent duplicate submissions, you can enable the set Unique Questions option on the form's settings, please refer to this guide: How-to-set-Form-Limits-Based-on-a-Unique-Question

    Please let me know If in any case, I misunderstood your question. Thank you.

  • pargev2010
    Replied on August 8, 2020 at 5:51 AM

    hi KrisLei,
    Thank you for the response.
    But the question is another.

    I have the "Appointment Planner widget" and some other widgets and the "Appointment Planner widget" is the first option.

    For example, When 2 users start to fill the form and there is only 1 available place. 

    When user 1 submits his/her request there are no more available places for user 2.
    But there is no check for user 2 on the submit button. (available places are being checked only on page load)
    How to set an error message when user 2 submits his/her form to say that there are no more available places?

    Thanks

  • Girish JotForm Support
    Replied on August 8, 2020 at 8:23 AM

    When you use the Appointment Planner widget - when you use one place, it automatically disables that widget for the next user.

    So when user 2 fills the form, they see the widget as disabled and also that there are no places available:

    15968890940808 11 Screenshot 10

    Else, you can add a Text (paragraph) field on the form and show it on the form using conditions:

    15968893550808 12 Screenshot 21

    You can check this demo form: https://form.jotform.com/202202982039955 (select the second option from the first question.

    Do review and let us know if that helps



  • pargev2010
    Replied on August 8, 2020 at 5:31 PM

    Hi,


    Thank you for the response.
    The difficulty is that this form should be used very short time, but a lot of users should use it parallel. So if there are only 1 available place and 2 users start to fill the form parallel (in that moment 1 available place exists) but one user submits a little bit earlier than another all users can submit (because on page load there was 1 available place). So in fact, 2 or more people can submit for one place. If user 2 refreshes the page yes he/she will see that no places are available. So if possible I'd like to add a condition on the submit button, if possible. when user press the submit button first check available places one more time and if it is not 0 continue submission. otherwise, write messages or disable the field. Please find video recording of my case.

    https://drive.google.com/file/d/1xsRJMxE-kPMZ923Jy01M9yH68zwev-Qf/view?usp=sharing


    Thanks

  • KrisLei Jotform Support
    Replied on August 8, 2020 at 7:04 PM

    Thank you for the additional details.

    I have watched the video of the issue you are referring to. Kindly give me more time to test it further on my end and see if there's a workaround for your requirements. 

    I will get back to you as soon as possible. Thank you. 

  • KrisLei Jotform Support
    Replied on August 8, 2020 at 8:18 PM

    Thank you for patiently waiting. 

    It seems that your requirements are possible with the Quantity Gift Registry widget, the widget automatically update the quantity when a user submits the form.

    For reference: Quantity Gift Registry

    It will show an error message when a user selects an item that is no longer available even when the form is accessed on a different location, browser or device. Please refer to my screencast below:

    1596930033test form Screenshot 10

    You can also customize it similar to the format on the Weekly Appointment Planner widget. 

    However, when I tried the Weekly Appointment Planner on my end using a different form its behaviour is similar to the Quantity Gift Registry widget:

    1596931933test form1 Screenshot 21

    This could be a bug on your form but before I escalate this to our developers, please try to click on the Update button on the widget and try a test submission again.

    1596932184Widget Screenshot 32

    I have also cleared your form cache on my end as well, let's see if it will make a difference. 

    Kindly get back to us to confirm if the issue persists. Thank you.

  • pargev2010
    Replied on August 30, 2020 at 5:28 PM
    Hi
    why do I see 404 error for my forms?
    e.g. https://form.jotform.com/202104805272444
    Thanks
    ...
  • Girish JotForm Support
    Replied on August 30, 2020 at 6:53 PM

    Hello,

    When  I opened your form, I am not viewing any 404 error:

    15988279363108 1 Screenshot 10

    Where are you seeing the 404 error? Is it while opening the form or submitting the form?