jquery ajaxsubmit

1 view
Skip to first unread message

杨钰

unread,
Jan 9, 2013, 1:41:45 AM1/9/13
to pyi...@googlegroups.com
$("#form").submit(function()
{
$(this).ajaxSubmit()
{
dataType :"html",
success:function()
{
alert("ss");
},
error:function()
{
alert("44");
},
}
});

xcluo

unread,
Jan 9, 2013, 1:48:13 AM1/9/13
to pyi...@googlegroups.com, 杨钰
使用ajax提交form 表单, 要先定义,后提交, 类似于这样:

$('#form_release').submit(function(e){
alert(e);
});

$('#button').bind('click', function(){ //修改cnname
if (confirm('确认修改?')){
$('#form_release').submit();
}
});



<form action="{% url projectadmin_manage_release_modify project.id
%}" method='GET' id='form_release'>

feojwqfejqwfeiwqf
</form>
--
Best Regards
-------------------------------------
雒兴晨 Simon, Luo
weibo: @秦王的弓
Mail: xclu...@gmail.com
MSN: lx_...@hotmail.com
-------------------------------------

杨钰

unread,
Jan 9, 2013, 1:57:22 AM1/9/13
to pyi...@googlegroups.com
����������󣬱�Ĵ���˵ success:function �е�success����Ч�ı�ǩ












�� 2013��01��09�� 14:48, xcluo �:
> ʹ��ajax �ύform �?�� Ҫ�ȶ��壬���ύ�� ����������
>
> $('#form_release').submit(function(e){
> alert(e);
> });
>
> $('#button').bind('click', function(){ //�޸�cnname
> if (confirm('ȷ���޸ģ�')){
> $('#form_release').submit();
> }
> });
>
>
>
> <form action="{% url projectadmin_manage_release_modify project.id %}"
> method='GET' id='form_release'>
>
> feojwqfejqwfeiwqf
> </form>
>
>
>
> �� 2013/1/9 14:41, ���� �:

xcluo

unread,
Jan 9, 2013, 2:04:00 AM1/9/13
to pyi...@googlegroups.com, 杨钰
是Ajax的错误吗? Ajax是这样写的:
$('#button_cnname').bind('click', function(){ //修改cnname
if (confirm('确认修改?')){
$.ajax({
url:'{% url projectadmin_manage_change_cnname
project.id %}?cnname='+$('#input_cnname').val(),
success:function(data,textStatus){
show_msgs();
$('#input_cnname').val(data);
},
error: function(data){
alert(data);
}
});
}
});

我看你代码没有success, 是不是别的地方的错误



于 2013/1/9 14:57, 杨钰 写道:
> 不是这个错误,别的错误说 success:function 中的success是无效的标签
>
>
>
>
>
>
>
>
>
>
>
>
> 于 2013年01月09日 14:48, xcluo 写道:
>> 使用ajax 提交form 表单, 要先定义,后提交, 类似于这样:
>>
>> $('#form_release').submit(function(e){
>> alert(e);
>> });
>>
>> $('#button').bind('click', function(){ //修改cnname
>> if (confirm('确认修改?')){
>> $('#form_release').submit();
>> }
>> });
>>
>>
>>
>> <form action="{% url projectadmin_manage_release_modify project.id %}"
>> method='GET' id='form_release'>
>>
>> feojwqfejqwfeiwqf
>> </form>
>>
>>
>>
>> 于 2013/1/9 14:41, 杨钰 写道:
>>> $("#form").submit(function()
>>> {
>>> $(this).ajaxSubmit()
>>> {
>>> dataType :"html",
>>> success:function()
>>> {
>>> alert("ss");
>>> },
>>> error:function()
>>> {
>>> alert("44");
>>> },
>>> }
>>> });
>>>

Reply all
Reply to author
Forward
0 new messages