Check null value in form field

Events happening in the community are now at Drupal community events on www.drupal.org.
srinikasturi's picture

Hi,

Just started with this awesome module!

I am trying to create a rule where 'form element fieldname value check' needs to look at the field, and do something only if it is a null value. Entering 'null' in the value text area does not do the job. Leaving it blank is not possible as it is a mandatory field. How do I do this with rules, without hacking the other module that is creating the form?

Thanks
Srini

P.S.

I tried putting the condition (with negate)

<?php
return array( 0 => array('value' => NULL));
?>
in the value text area as suggested in http://drupal.org/node/675222 and it worked, but it is redirecting every time, even when the field value is not null.

Thanks

Comments

Change 'value' to something else

itangalo's picture

I think you need to change the array key ('value') to something else. For node references, it should be 'nid'.
If you got Devel installed, try the Devel tab and see what the array keys look like.

Good luck!
//Johan Falk, NodeOne, Sweden

Thank you. I'll try that and

srinikasturi's picture

Thank you. I'll try that and update the thread.

try <?php print NULL; ?>

shaundychko's picture

try <?php print NULL; ?>

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: