Q:

How to get the changed value in Input Text?

0

This code will help you to understand how to get the changed value in Input Text

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Use input change event to get the changed value in onchange event argument. If you bind using the two-way bind to value property, it will automatically change the value into the Value property.

<input placeholder="Enter your text" @onchange="@onChange" />

@code {

    private string value { get; set; }
    private void onChange(Microsoft.AspNetCore.Components.ChangeEventArgs args)
    {
        value = (string)args.Value;
    }
}

or

<input placeholder="Enter your text" @bind-value="@value" />

@code {

    private string value { get; set; }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now