Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

janokary's avatar

disable input checkbox

Hi I want to disable input checking based on the variable "name". So if "name" is empty the check should be disabled otherwise it will be enabled.

Here is the example http://jsfiddle.net/janokary/7ab9s1fe/

What I found is that the html rendering is not working. Any Ideas?

0 likes
3 replies
pmall's avatar

This should work <input type="checkbox" {{ $name ? '' : 'disabled' }}> what doest work ?

Ernest's avatar
Ernest
Best Answer
Level 1

Hello,

try this:

 <input type="checkbox" :disabled="name ? false : true">
1 like

Please or to participate in this conversation.