-1
我想在点击标签后自动提交,我用Jquery,但它没有工作。在Razor自动提交表格
这是我的jQuery代码:
<script type="text/javascript">
$("#tt").click(function() {
$("#demo-form2").submit();
});
当T使用提醒功能,它工作正常测试:
<script type="text/javascript">
$("#tt").click(function() {
alert("Bye! You now leave p1!");
});
TT是标签的ID我点击 这是剃须刀代码:
@using (Html.BeginForm("Index2", "Commande", FormMethod.Post, new { @class = "form-horizontal form-label-left", role = "form", @id = "demo-form2" }))
{
@Html.ValidationSummary(true)
<table>
<tr>
<th id="tt">
Code Article
</th>
</tr>...
}
帮助,
一些html请吗? – Satpal
是你的表单的正确ID吗?你能分享其余的代码吗?如果这是你的页面中唯一的表单,你可以试试$('form')。submit(); – Nikitesh
正确检查表单ID! – Poria