I’m doing management software for a travel company with PHP/Laravel.
What I want to have is as shown below:
<input type="checkbox" checked onclick="return false;" />
i.e. a checked and read-only checkbox.
So far no problem except that I have to do this only if a condition occurs, i.e. I have to have the checkbox checked and read-only only if the condition is true; in particular I must say that if the number of nights stayed is greater than 0 then the checkbox must be checked and read only, therefore it is not possible to modify it.
WARNING: I DO NOT want the checkbox disabled
I tried to do as shown in the following code, but only the checked works.
<input type="checkbox" {{$client->stay_night > 0 ? 'checked' : ''}} {{$client->stay_night > 0 && 'onclick="return false;"'}} />
Can anyone help me do this? I would be very grateful!