我有一个 AJAX 表单,我想在单选按钮更改事件中提交它。
AJAX 形式:
@using (Ajax.BeginForm("Vote", "Rate", null ,
new AjaxOptions
{
InsertionMode = InsertionMode.Replace,
HttpMethod = "GET",
OnFailure = "searchFailed",
LoadingElementId = "ajax-loader",
UpdateTargetId = "searchresults",
},new { id = "voteForm" }))
{
<input type="radio" name="Stars" value="1">
<input type="radio" name="Stars" value="2">
<input type="radio" name="Stars" value="3">
}
我使用以下代码,但它不起作用。
$("#voteForm").ajaxSubmit({ url: '/Vote/Vote', type: 'get' });