0
Array
(
[account]
   [notify] => Array
                (
                    [#type] => checkbox
                    [#title] => Notify user of new account
                    [#access] => 1
                )

)

I want to checkbox on user_registration_form must be checked by default. I did $form['account']['notify']['#default_value'] = array(1); but it does't work.Suggest something.

2
  • 2
    Have you tried this $form['account']['notify']['#default_value'] = TRUE;
    – Vamsi
    Commented Sep 8, 2015 at 5:43
  • @Vamsi consider adding your suggestion as an answer to the question.
    – niksmac
    Commented Sep 8, 2015 at 6:16

1 Answer 1

0

Please Try this

$form['account']['notify']['#default_value'] = TRUE; 

Thank You.

1
  • its done ...working fine... Commented Sep 9, 2015 at 4:55

Your Answer

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

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