Is there a way to make an input visible based on a bool variable?
<input type="button" value="Smth" onclick="...">
I am trying to find an HTML helper for this purpose, however no luck so far.
Is there a way to make an input visible based on a bool variable?
<input type="button" value="Smth" onclick="...">
I am trying to find an HTML helper for this purpose, however no luck so far.
2
Answers
try this
You can achieve your required result to set your
input
field as disabled by using theternary conditional
operator:Where
myBoolCondition
is your variable holding the result of your condition.