I am inserting radio button value like (0 or 1) in database.but in my edit page i am not getting the value.it showing
undefined
Here is my insert code.
</td>
<td align="center">
<label style="color:red"> @Html.RadioButtonFor(x => x.H_TO_V_Y_CITATION, 0, new { @class = "form-control", @checked = "checked" }) On The Line</label>
</td>
<td align="center">
<label> @Html.RadioButtonFor(x => x.H_TO_V_Y_CITATION, 1, new { @class = "form-control" })Superscript</label>
</td>
// here is my edit page to fetch the data..
$('#DataFetch').click(function () {
if ($('#ddlCode').val() == "" || $('#ddlType').val() == "" || $('#ddlName').val() == "") {
debugger;
alert("Please select appropriate value");
window.location.href = "/StyleCreator/EditHarvardToVancover";
}
else {
$.ajax({
url: '/StyleCreator/getHar_To_Van',
dataType: "json",
async: false,
contentType: "application/json;charset=UTF-8",
data: { Type: $('#ddlType').val(), Name: $('#ddlName').val(), Code: $('#ddlCode').val() },
success: function (data) {
$('#t1').html($('#ddlType').val())
$('#t2').html($('#ddlName').val())
$('#t3').html($('#ddlCode').val())
debugger;
$("input[name='H_TO_V_G_CITATION'][value='" + data.H_TO_V_G_CITATION + "']").attr('checked', true)
$("input[name='H_TO_V_R_CITATION'][value='" + data.H_TO_V_R_CITATION + "']").attr('checked', true)
$("input[name='H_TO_V_Y_CITATION'][value='" + data.H_TO_V_Y_CITATION + "']").attr('checked', true)
/
},
error: function () {
alert("error");
}
})
}
})
What I have tried:
$("input[name='H_TO_V_G_CITATION'][value='" + data.H_TO_V_G_CITATION + "']").attr('checked', true)