Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to enable/disable inputs in blazor

$
0
0

I am trying to Enable/Disable a group of time inputs in Blazor based on a checkbox ; while for inputs of type button the below solution works ,for inputs of type time it doesn't :

Solution for button input that works:

<button type="button" class="@this.SetButton"></button>[Parameter] public bool state { get; set; }public string SetButton() {    string result = state ? "" : "disabled";    return result;}

Attempt for time inputs that does not work:

<input bind="@IsDisabled" type="checkbox" />                      <input class="@this.GetGroupState()" type="time" />protected bool IsDisabled { get; set; }public string GetGroupState() {    return this.IsDisabled ? "disabled" : "";}

P.S.: In the first scenario the bool comes as a parameter from another component so I don't bind it. In the second case, however, it is bound to the checkbox.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>