0

I have a checkbox form element that uses taxonomy terms via variable_get as #default_value; storing the result. I don't want to overwrite value, I just want the form to render/display checked initially.

  $form['search_block_topic'] = array(
    '#type' => 'checkboxes',
    '#options' => $topic_options,
    '#default_value' => variable_get('search_topic_options', $topic_options)

I tried '#return_value' => "checked" which doesn't work.

2
  • You mean besides the default value, you want another option to also be checked?
    – No Sssweat
    Commented Oct 8, 2020 at 3:41
  • I would like all the check boxes to initially be checked but then store with a form_submit function. Right now the store works fine but they start unchecked.
    – kubak
    Commented Oct 8, 2020 at 11:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.