I have set #states with required option when field B is checked, field with required #states is a select with radio buttons, when field B is checked, it show red asterisk radio buttons in title and all radio button of field.

I want the red asterisk only on the title of the field

Comments

Mirkozzo’s picture

Field A is boolean with 2 radio button, when #States set required, 3 red asterisk appear, 1 on title of field and 2 on radio buttons

My code: IF Field B sas value -> Require Field A

$form['field_A']['#states'] = array(
   'required' => array(		
      ':input[name="field_B[und]"]' => array('value' => '1'),
         ),
      );
Mirkozzo’s picture

This is my screenshot

Required Field screenshot

john_b’s picture

There is an open core issue for this https://www.drupal.org/node/1017882. There is a range of possible workarounds https://www.drupal.org/node/141790.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors