0

Is it possible to do this, and how? I have checkboxes which are either ticked or unticked and they need to be disabled. I have tried the following with no luck

// ticked

Form::checkbox(
    $formOption['data']->ant_answer_type_id, 
    $formOption['data']->ant_answer_title, 
    true,
    array('disabled')
)

// unticked

Form::checkbox(
   $formOption['data']->ant_answer_type_id, 
   $formOption['data']->ant_answer_title, 
   array('disabled')
)
3
  • i am new to laravel, but have you tried jquery disabling?? Commented Oct 11, 2014 at 14:24
  • There is no difference between those 2 code snippets! Commented Oct 11, 2014 at 14:44
  • @Marcin your answer is the correct one and for the live of me I don't know why my code snippet wasn't working. Unfortunatly while it did disable the checkboxes it didnt produce the desired results (The result I wanted was that they were disabled but still displayed previous input). I have since found the solution with the desired result and will post the answer late today. Commented Oct 13, 2014 at 8:18

1 Answer 1

3

In both codes above you set true so both of them are checked.

When you use:

{{ Form::checkbox(
    'test',
    1,
    true,
    array('disabled')
)
}}

{{ Form::checkbox(
    'test2',
    2,
    false,
    array('disabled')
)
}}

you will get 2 disabled checkboxes, first checked, second unchecked

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.