Closed (fixed)
Project:
Rules
Version:
6.x-1.2
Component:
Forms Support
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2010 at 09:00 UTC
Updated:
1 Jun 2012 at 22:38 UTC
hi there,
im trying to create a rule which has a condition for evaluating a checkbox. i've added the checkbox from my own module via hook_form_alter like this (a little simplified):
function foo_form_alter($form_id, &$form)
{
$form_id['invite'] = array(
'#tree' => true,
'body' => array(
'#type' => 'fieldset',
'#collapsible' => false,
'#title' => 'Invitation',
'#tree' => true,
'users' => array(
'#type' => 'textfield',
'#title' => t('Recpt.')
),
'message' => array(
'#type' => 'textarea',
'#title' => t('Message'),
'#value' => t('blub'),
),
'send' => array(
'#type' => 'checkbox',
'#title' => t('Send invitation on next save'),
'#value' => 0
),
'#collapsed' => false
)
);
return $form_id;
}
i've activated form events and created a rule on form submission with a condition which checks the value of the checkbox. i've used "invite[body][send]" as the form id and checked for value "true", "1" and "on", but all evaluate to false.
Comments
Comment #1
klausicheck the weight of your module, it should be less than 20 (so that the rules_forms_form_alter() comes after your module).
Comment #2
mitchell commented