I'm using the "legal" module version 6.x-8.5.
This is a great module, but i think there's a form_set_error()
message needed, to show the user which's trying to register, why registering cannot be applied, if he forget to click the required checkbox(es).
I'm looking for a possibility to get this working.
Does anybody know where to implement this function(hardcoded, if there isn't a other solution) in the module?
I also tried to do this with rules forms, with this rule:
array (
'rules' =>
array (
'rules_register_ckeck_agb' =>
array (
'#type' => 'rule',
'#set' => 'event_user_register_form_validate',
'#label' => 'Register ckeck AGB',
'#active' => 0,
'#weight' => '0',
'#categories' =>
array (
),
'#status' => 'custom',
'#conditions' =>
array (
0 =>
array (
'#settings' =>
array (
'element' => 'legal[legal_accept]',
'value' => '1',
'#argument map' =>
array (
'form' => 'form',
'form_state' => 'form_state',
),
),
'#type' => 'condition',
'#name' => 'rules_forms_condition_element_value',
'#info' =>
array (
'label' => 'Form element \'legal[legal_accept]\' value check',
'arguments' =>
array (
'form' =>
array (
'type' => 'form',
'label' => 'Formular',
),
'form_state' =>
array (
'type' => 'form_state',
'label' => 'Form state',
),
'element' =>
array (
'type' => 'string',
'label' => 'Form element ID',
'description' => 'ID of the form element to be targeted. Examples on the "Create Story" form: "title" for the title field or "body_field[body]" for the body field.',
),
'value' =>
array (
'type' => 'string',
'label' => 'Value(s)',
'description' => 'Value(s) assigned to the form element. If the form element allows multiple values, enter one value per line.',
),
),
'module' => 'Rules Forms',
),
'#weight' => 0,
'#negate' => 1,
),
),
'#actions' =>
array (
0 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Set form error on element \'legal[legal_accept]\'',
'arguments' =>
array (
'form' =>
array (
'type' => 'form',
'label' => 'Formular',
),
'element' =>
array (
'type' => 'string',
'label' => 'Form element ID',
'description' => 'The element that should be marked. Examples on the "Create Story" form: "title" for the title field or "body_field[body]" for the body field.',
),
'message' =>
array (
'type' => 'string',
'label' => 'Nachricht',
'description' => 'The message that should be displayed to the user.',
),
),
'module' => 'Rules Forms',
),
'#name' => 'rules_forms_action_set_error',
'#settings' =>
array (
'element' => 'legal[legal_accept]',
'message' => 'Please Confirm the...',
'#argument map' =>
array (
'form' => 'form',
),
),
'#type' => 'action',
),
),
'#version' => 6003,
),
),
)
But this also does not the job, it should do. Does anybody know what I'm maybe doing wrong here? Thanx for all your suggestions. regards dennis605