I'm trying to compare two date fields on form validation.

I've added the 'my_form node form is being validated' event fine. I go to add a data comparison condition and any data selector provided by this module (textfield:title for example) throws an error when hitting continue "Data selector textfield:title for parameter data is invalid.". Wondering if I'm doing something wrong or if this is a bug? Do I need to expose anything else in the conditions first for this to work? If so, why are the form field values showing as available selectors when adding a data comparison condition?

Comments

norwegian.blue’s picture

Subscribe.

There seem to be several issues relating to this but no work-around or solution.

Can any one help?

coreteamvn’s picture

subscribe.

in my case im trying to compare the value of a field (decimal) on the node add form with a user profile field (decimal). the user should only be able to create a node when he has enough points.

when i select data comparison i get this message:

Data selector textfield:field-pointstest:und:0:value for parameter data is invalid.

pixelsweatshop’s picture

Seeing this as well when trying to just check to see if the city (locality) field of an addressfield form is empty.

Adding a couple related questions already in the queue.

kris77’s picture

You can not compare two dates in rules?
I must compare two dates in rules to know how old...

Thanks

caminadaf’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, instead of using "Data comparison", please use "Form Element has value" instead.
All of the Rules Forms elements need to be used with the Rules Forms conditions and actions for now.

Please let me know if after using the condition above you still have any issues