Hi,

I have the rules forms support enabled and trying to use the rules condition "Form element has value"
I would like to check if no values are selected for Form element ID: field_example[value] so I kept "Value(s): *" empty, but when I click save I get the error Value(s) is required.

How may I have the condition result TRUE if no values are selected?

Thank you

Comments

fourmi4x’s picture

I would love to know that to!
I tried with '' and 0 and NULL , and all "levels" of form ids but none of this work...

In the meantime you can do still it with the action "Execute PHP code" and something like:

return empty($form['field_ref']['0']['value']);

Cheers!

mitchell’s picture

Project: Rules » Rules Forms Support
Version: 6.x-1.x-dev » 7.x-2.x-dev
Component: Forms Support » Code

Perhaps there can be a backport.

daniel.nitsche’s picture

Have you tried leaving the value empty, but checking the "negate" checkbox? That works for me. Now, if I could only work out how to make it work for checkbox input types.

daniel.nitsche’s picture

Sorry, I just realised I didn't really answer your question. The negate option may be helpful anyway.

caminadaf’s picture

Version: 7.x-2.x-dev » 7.x-1.0
Issue summary: View changes

This is a valid feature that I've already implemented on a site I support. I'll be moving that feature here.

caminadaf’s picture

Status: Active » Fixed

Commited on 7.x-1.x

  • caminadaf committed 1265d96 on 7.x-1.x
    Issue #921836 by caminadaf: rules forms support: unable to check if no...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.