I have a field in my webform. When the field ('test') is NOT in a fieldset my statement below works perfectly:

if ($data['components']['test']['value'][0]=='0') { return TRUE; } else { return FALSE; }

When I add my field to a fieldset ('promoter_id'), the statement above no longer works and I'm not sure how to change it to make it work. I would greatly appreciate any help with this issue.

Comments

tsmulugeta created an issue.

tsmulugeta’s picture

It seems to be working now. I'm not sure what fixed it. It might have been a misspelling. But whether or not a field is a fieldset, it is printed the same.

In order to debug, I found a great way:

  1. Install the Devel Module: https://www.drupal.org/project/devel
  2. Make sure you have the module, Webform Rules installed
  3. Create a new rule by going to: admin/config/workflow/rules
  4. Create a new rule with the following settings: EVENT: After a webform has been submitted, CONDITIONS: none, ACTIONS: Execute custom PHP code
  5. For ACTIONS: Execute custom PHP code - enter dsm($data);
  6. Save
  7. Now when you submit a form you will see the results