1

I have created a radio buttons field in entity form. I just want to move yes label above and No label below. How to achieve that i am not getting any option.

enter image description here

0

You can try hook_form_alter to reorder your field options.

function modulename_form_alter(&$form, &$form_state, $form_id){

  if($form_id == 'myform_id'){

    $form['field_like_event']['und']['#options'] = array(1 => 'Yes', 0 => 'No');
  }
}

Note: You can change the "On" and "Off" values by interchanging "Yes" as Off value (0) and "No" as On value (1) at edit form field settings. But in general we will use 1 for "Yes" and 0 for "No". My suggestion is to use form alter method.

0

In field edit settings page, you can organize your options in "Allowed values list" section.

1
  • Thanks for your reply. But i am facing this problem when my field type in Boolean. – DRUPWAY Jul 14 '15 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.