<tr>
<td>Dated:
</td>
<td>
<input type="text" id="txtdate" name="Dated" value="" required />
</td>
</tr>
这是我的 DateProperty 的 Html 文本框
function claimsubmit() {
var claimtype;
if ($('.boxGroup a').attr("id") != '') {
claimtype = $('.boxGroup a').attr("id");
}
var claimname = {
//ClaimTypeId: $('.boxGroup a').attr("id"),
ClaimTypeId:claimtype,
BillNumber: $('#txtbillnum').val(),
Amount: $('#txtamnt').val(),
Reason: $('#txtreason').val(),
Dated: $('#txtdate').val(),
Id: $('#Id').val()
}
alert(JSON.stringify(claimname));
$.ajax({
url: '/api/ClaimAPI', type: ($('#claimform').find('#Id').val() == '0' ? 'Post' : 'Put'),
datatype: 'json',
data: $.param(claimname),
success: function (data) {
//alert(data);
alert("Claim Details are Submitted Successfully");
},
Error: function (data) {
alert("Problem while Save Claim Details")
}
});
}
这是用于插入的 javascript,并且在控制器中获取默认的 sqldate 未选择日期