<div style="width:20%; margin-top:5px">
<form id="myForm">
<span>Sendy</span> <span style="margin-left:40px"> @Html.TextBoxFor(model => model.Sendy, new { @class = "form-control", @placeholder = "Sendy" })</span>
<span>Vco</span> @Html.TextBoxFor(model => model.Vco, new { @class = "form-control", @placeholder = "Vco" })
<span>AcBal</span> @Html.TextBoxFor(model => model.AcBal, new { @class = "form-control", @placeholder = "AcBal" })
<span>Amount</span> @Html.TextBoxFor(model => model.Amount, new { @class = "form-control", @placeholder = "Amount" })
<br />
<input type="reset" value="Submit" class="btn btn-success" id="btnSave" />
</form>
</div>
<script>
$(function () {
$("#btnSave").click(function () {
var data = $("#myForm").serialize();
$.ajax({
type: "POST",
url: "/Codian/Sendia",
data: data,
success: function (response) {
alert("Successful")
},
error: function () {
alert("Failed! Pleased try again")
}
});
});
});
</script>
The result is always Failed! Pleased try again.
I do not know where i went wrong.