<% using (Html.BeginAbsoluteRouteForm("PetDetail", new { controller = "Customers", action = "SavePetSitterRestrictionsAndPermissions", ownerKey = Model.Owner.Key, petKey = Model.Key }))
{ %>
<button type="submit" class="actionButton default">
Save</button>
<% }
} %>
我上面的代码为submit a form
,我需要在disable a save button
之后点击保存按钮。点击提交后按钮
通过使用jquery该怎么做?
我试过的东西看起来像下面:
var clickedBttn=$('.actionButton.default[type=submit][clicked=true]').val()
if (clickedBttn)
{
//btton disable code here
}
但never fires
上面的代码。
当我注册了“点击事件”它会激发我的正常“表单提交”操作吗?它发生的顺序是什么?点击后是点击还是什么? – Sampath 2013-02-13 10:12:30
在实际提交之前点击。但我不认为这应该是一个问题。实际上,你可以将它改为'$(“#PetDetail”)。submit(function(){$('。actionButton.default [type = submit]')。prop(“disabled”,true);})' – 2013-02-13 10:14:50
我可以使用上面提到的代码与我上面提到的我的普通html代码,还是应该更改我的html代码(表单邮政编码)?这里“#PetDetail”是表单ID吗? – Sampath 2013-02-13 10:21:43