Form selective emails validation rules issue


(John) #1

Hello,

I am having difficulties with the selective email rules ignoring a validation condition. I have created a simple form consisting of a select input and a Yes/No option list:

I have created selective e-mail rules so the submissions are sent to different e-mail addresses depending on the dropdown category selection. This part works fine.

I would like to add a validation condition so that the email does not send if ‘No’ radio button is selected. I assume the value of Yes is 0 and No is 1. My rule looks like this:

From what I understand, the above rule should only send an e-mail if Category 1 and Yes are selected. However when I select No, it still sends the e-mail.

It looks like the Validation condition is being ignored. Can anyone help me out here?

Thanks!


(John gill) #2

How weird do you think the answer is going to be?

Ok, triple that.

I suspect that you’ve his the same issue I ran into when dealing with Conditional Visibility. (I don’t know for sure that the selective email has the same issue but I’d bet for it before I bet against it.)

I think the issue I hit is that if you try to match something to "0" then PHP will do it’s dynamic language thing and turn "0" into 0 and 0 into false instead of actually running the regex.

So the workaround is instead of matches '0', you want doesn’t not match '0'

image

I believe that using ^[^0]|[0-9]{2,5}$ with the “Does not match a regex” option should do it, for radio button groups with less than 100,000 options.


(John) #3

Thanks, you’re the (timber) man!