我尝试使用 jquery 在我的表单中禁用输入,但没有工作......
看法:
@using (Html.BeginForm("Create", "Contrato", FormMethod.Post, new { id="formContrato"}))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
.
.
.
}
脚本:
<script>
$('#formContrato').keypress(function (event) {
if (event.keyCode == '13') {
event.preventDefault();
}
});
</script>