Disable Form Submission - can I use multiple conditions?

Hi Retool Support!

I'm currently tinkering with the "Disable Form Submission" option.

If I place one condition:

 {{DepToPay_DepositQuery.data.RAWDEPOSITBALANCE <= 0 }} 

Retool evaluates this to 'false' and the "Submit" button stays lit (not greyed out). This is correct and expected behavior given my current test data where the RAWDEPOSITBALANCE value is 600.

Am I allowed to put multiple conditions? For example:

 {{DepToPay_DepositQuery.data.RAWDEPOSITBALANCE <= 0 }}  and  
 {{DepositToLease_Amount.value > DepToPay_DepositQuery.data.RAWDEPOSITBALANCE }}

My test data yields "false and false" logic by Retool (which is correct). I would expect the "Submit" button to stay lit, but instead it is greyed out.

Basically - if I use one condition, I have no issues. If I have multiple conditions, it doesn't appear to work.

Is my syntax wrong?

Thank you!

Hey @PL13!

Great question, this should be possible but I believe you would need to use the JS logic for the and part here, could you try:

{{ (DepToPay_DepositQuery.data.RAWDEPOSITBALANCE <= 0) && (DepositToLease_Amount.value > DepToPay_DepositQuery.data.RAWDEPOSITBALANCE) }}

to see if this works for you?

1 Like

Brilliant @Chris-Thompson ! Talk about speedy response + great solution!

It works for me! Except my logic should actually use || instead of &&. (I knew there was a reason behind first year logic courses!).

Thanks a bunch!

1 Like

Anytime! :)