WeeklyJr Posted August 1, 2019 Share Posted August 1, 2019 Hello, how can I make a disabled checkbox within renderForm() function? I'm making a custom form with some basic fields. This is what I have right now when it comes to checkbox, I only need to disable it (prevent from changing its value). array( 'type' => 'checkbox', 'name' => 'admin', 'col' => 4, 'values' => array( 'query' => array( array( 'id' => 'on', 'name' => Context::getContext()->getTranslator()->trans('Checkbox'), 'val' => 1, ) ), 'id' => 'id', 'name' => 'name', ), ) Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted August 1, 2019 Share Posted August 1, 2019 4 minutes ago, WeeklyJr said: Hello, how can I make a disabled checkbox within renderForm() function? I'm making a custom form with some basic fields. This is what I have right now when it comes to checkbox, I only need to disable it (prevent from changing its value). array( 'type' => 'checkbox', 'name' => 'admin', 'col' => 4, 'values' => array( 'query' => array( array( 'id' => 'on', 'name' => Context::getContext()->getTranslator()->trans('Checkbox'), 'val' => 1, ) ), 'id' => 'id', 'name' => 'name', ), ) Hi... add this fields in you array 'disabled' => true, Link to comment Share on other sites More sharing options...
WeeklyJr Posted August 1, 2019 Author Share Posted August 1, 2019 I tried to add this in each array within the checkbox and unfortunately it doesn't work. Link to comment Share on other sites More sharing options...
WeeklyJr Posted August 2, 2019 Author Share Posted August 2, 2019 Any other solution? I'm stuck :/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now