I have a problem with my radio buttons in the components I've created. Each component has its own set of radio buttons that interact with the database. The issue is that when I select a radio button in one component, it deselects the radio button in the other components. How can I fix this so that I am able to select radio buttons in all components simultaneously?
Here are the radio buttons:
<label class="GroupTitle">Filters:</label><br/>
<input type="radio" name="number" id="all" checked="@checkedRadio("all", FileFilter)" @oninput="@(() => UpdateFilter("all"))" />
<label for="">Clear all files</label><br />
<input type="radio" name="number" id="number" checked="@checkedRadio("number", FileFilter)" @oninput="@(() => UpdateFilter("number"))" />
<label for="">Based on number of files</label><br />
<input type="radio" name="number" id="date" checked="@checkedRadio("date", FileFilter)" @oninput="@(() => UpdateFilter("date"))" />
<label for="date">Based on date of files</label><br />
The function checkedRadio() looks like this:
private bool checkedRadio(string state, FileFilter Filter)
{
if(state == Filter.Filter)
{
return true;
}
else
{
return false;
}
}
And here's the UpdateFilter() function:
private void UpdateFilter(string option)
{
filter = option;
FileFilter.Filter = option;
}