I use EditForm in my Blazor application for submitting information from a blank form as well as a form that has been initialized with data fetched from a database. When I initialize the form with data from database, I want to keep the Submit button disabled until some input takes place. If no input takes place, the button should remain disabled, because there is no new information to be saved.
So I need an input detector of some sort on which I can trigger the Submit button disabled flag. What is the correct way of achieving this? So I need something like this:
<EditForm Model="MyModel">
<InputText type="text" @bind-value="x" @oninput="OnInput"/>
</EditForm>
private void Oninput(){
IsDisabled = false;
}
What's the correct way of achieving this that works with all sorts of inputs (text input, radio, check boxes etc.)