Conditionals not updating quick enough

I have a PopUp in which users choose how many items they want to collect from an order. This is it…(Pls ignore the alignment in the right column!)

Conditions Not Running

Thanks to valuable help yesterday, I’ve sorted out a major confusion with the logic but I’ve still got a problem.

Say a user chooses to collect 7 items and there are only 6 available (as in the 2nd row) , the input’s border and font will go red and they’ll know something’s up. That works fine. But I also want the “Collect” button to be disabled at the same time to prevent the collection process from runnning. However, while the condition I have attached to the button does work, it only runs when the used clicks somewhere within the PopUp but not on the button which seems to cause the button to go “Oh yeah, there’s a condition here that needs triggering”. It means that if the user hits the button directly after entering an amount to collect that is greater than the amount available, the collection will go through…

What can I do to make the condition on the button run as soon as the Input in which the User puts their required amount?

Hi there, @joefarrowsmith… as I mentioned yesterday, I would make the button not clickable by default and have a condition on it that makes it clickable in order to avoid the situation you described. That being said, you would still be in the same situation where the user would enter a value into the input, and the button won’t become enabled until the user clicks away from the input. That situation is better (in my opinion) than the current situation because at least the user can’t click the button until the quantity has been validated.

To overcome that situation in either case, you could give this plugin a shot. I have never used it, but it’s free, so you have nothing to lose by checking it out.

Hope this helps.

Best…
Mike

Hi Mike
Thanks again for this. I have changed it back to your suggestion yesterday to make the Collect button “Unclickable” by default which is indeed SO much easier (I reverted away from that while experimenting then forgot I’d done that!). It’s the clicking away from it to get an updated field that I’m having issues with now. The InputWatcher plugin would be amazing if I could only find any documentation on it or get any idea how it works. I’ve fumbled about with it all afternoon but I’m really nowhere with it but I can see it’s really useful…if only it came with some proper info for us novices.

I just did a quick test of that plugin, and it seems to work like a charm. First, give your input element an ID attribute. The attribute can be anything you want.

If you don’t see that field, go to your Settings >> General tab and check the box that says Expose the option to add an ID attribute to HTML elements.

Next, add a Watch Input element to the page, and enter the ID attribute of your input element.

Finally, add this workflow event, and add the appropriate action(s) in the event.

In your case, you would want to add an Only when condition to the event that says when the watched input is changed and its value meets the specified criteria, do something. The something you do might be to set a custom state, and you could have a condition on the button that makes the button clickable when the custom state is set to a particular value.

Anyway, just a bunch of food for thought there… hope it helps.

1 Like

Oh man that’s fantastic!!! Thank you!! I was so nearly there but my inner moron had silently stepped up and mispelled the name of one of the IDAttributes! You’re right. It’s working pretty well though now. The only weeny niggle is that the cursor doesn’t change to a hand now when the button becomes clickable but I’m not too fussed about that.

Thanks again. I owe you a drink!

1 Like