Hi team
I want to create a radio button that will once clicked do the check, when a user click on a radio button the value selected be saved on a database record. Does anyone ever worked on this on asp.net mvc 5 and javascript?
Hi team
I want to create a radio button that will once clicked do the check, when a user click on a radio button the value selected be saved on a database record. Does anyone ever worked on this on asp.net mvc 5 and javascript?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Nov 26, 2021, 2:53 AM EST
Vikas PanwarRank #1,447 · 1.1K reputationPosted Nov 26, 2021, 12:21 AM EST
Guest UserRank #877 · 2.5K reputationPosted Nov 26, 2021, 12:49 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 26, 2021, 1:22 AM EST
Guest UserRank #877 · 2.5K reputationPosted Nov 26, 2021, 2:15 AM EST
Sachin
This is what i have done so far, somehow the button does not save selected value to the db record. What am i missing?
// View
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
Application CheckList
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
PLC_Marshal
@Html.RadioButtonFor(model => model.Application_Check, "PLC_Marshal")
BVMS_PMON
@Html.RadioButtonFor(model => model.Application_Check, "BVMS_PMON")
Submit
}
// Controller
// checkbox to save values to the database.
[HttpPost]
public ActionResult SelectedValuesSaved(Application_Check checkList, FormCollection frm)
{
if(ModelState.IsValid)
{
var selectedAnswer = checkList.SelectedAnswer;
}
return View();
}
// Model
public class ApplicationName
{
public string SelectedAnswer { get; set; }
}