How can I require a checklist if the selected values don't add up correctly?

  • benmaki
    Asked on September 22, 2014 at 1:37 PM

    I have a set of check boxes and each item has a calculation value of 1 or 2.  The user must select items in the checklist so that the values add up to 8--so that would be between 4 and 8 items.

    How can I set it up so that the field is still required as long as the calculated value is not equal to 8?  It seems like the conditions aren't run unless you click in the field, so a rule to require it doesn't run if they don't pick anything.

    Here's what I have set up already:

    Rule 1: Require Checklist if Total does not equal 8

    Rule 2: Unrequire Checklist if total does equal 8.

    The checklist is marked Required.

    It will stop submission if nothing is checked.  But if anything is checked, it goes through, even if it doesn't equal 8.

  • Ben
    Replied on September 22, 2014 at 3:16 PM

    Hi

    I took a look at your jotform and it seems that you already got it working properly :)

    From what I see if there is any value other than 8 it will not show submit button, deeming the checklist required.

    Do let me know if I missed something, from what I understood that you are asking it seems to be implemented properly.

    Best Regards,
    Ben

  • benmaki
    Replied on September 22, 2014 at 4:02 PM

    Yes, that's correct.  Sorry I forgot to come update the question before I went to lunch.

    I'd prefer to disable the submit button rather than hide it, but this works too.

  • Ben
    Replied on September 22, 2014 at 4:29 PM

    Hi,

    Well, let us mix something up. It will not be the exact fix to the problem, but you might like it :)

    You should take a look at the form now http://form.jotformpro.com/form/42646290955968

    Now what I did was I have taken the image of the submit button, gave it a bit of shade and made it be shown while the conditions are not met. Now as soon as they are, the real submit button is shown and they can submit their form.

    I have also added a bit of CSS to show it where the original submit button is

    .form-image
    {
        left: -110px;
        position: relative;
    }

    You can see here how to inject that into your form if you decide to add add it yourself Inject Custom CSS Codes

    Also, this is the link to the image, so I would suggest saving it on your PC and then adding it to your jotform so that it does not get removed

    https://s3.amazonaws.com/jufs/Ben/form_files/submit_illusion.png

    It is not exactly what you wanted, but unfortunately there is no option of actually disabling the submit button and having it shown, just hiding it.

    Hope you like that new change.

    Best Regards,
    Ben

  • benmaki
    Replied on September 22, 2014 at 4:40 PM

    That works and isn't obviously a hack from the user's side like before.  I didn't use the css though because it was sticking it way out to the left.  I just left justified the submit button and they line up close enough.  You can really see them when you get the checklist values correct anyway, so there's no transition to worry about.

    Thanks for your help, Ben.

  • Ben
    Replied on September 22, 2014 at 4:50 PM

    Hi,

    I am glad that it is now working as you wanted it :)

    I used the CSS as it was shown too much to the right for me.

    I forgot to mention that I have placed conditionals that show the image when they hide the submit button and the other way around, but I guess that you found that already :) mentioning it here for others that might stumble upon this thread.

    Do enjoy your time with jotforms and let us know if you ever need any assistance again :)

    Best Regards,
    Ben