This is my html code.
<form id="item">
<div class="form-group col-lg-3 col-md-3 col-sm-3 col-sx-3">
<label for="itemtype">Hotel</label>
<input type="radio" class="radio" id="itemtype" name="optradio" value="H" checked>
<label for="itemtype">AirPort</label>
<input type="radio" class="radio" id="itemtype" name="optradio" value="A">
</div>
</form>
And this is my jquery.
function save() {
debugger
$.ajax({
type: "POST",
data: { "item": { "itemid": $("#itemid").val(), "itemtype": $('#itemtype').val() }},
url: "@Url.Action("Save", "Item")",
cache:false,
success: function (data) {
debugger
if (data.isSuccess) {
alert("Saved Succesfully!");
window.location.href = "@Url.Action("Index", "Item")";
}
}, error: function (err) {
alert("Saved Failed!")
debugger
}
});
}
All the time when I trying to save the item type call "A", it never happen. Always this query getting radio button value as "H". I need to pass the 2nd value "A".