Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为什么';jqueryajax不能工作吗?_Php_Jquery_Forms_Form Submit - Fatal编程技术网

Php 为什么';jqueryajax不能工作吗?

Php 为什么';jqueryajax不能工作吗?,php,jquery,forms,form-submit,Php,Jquery,Forms,Form Submit,我不明白为什么这张表格不发送 代码很长,我不认为把所有内容都发布在这里是个好主意 链接到表单 链接到脚本 我只是尝试在浏览器中加载PHP文件,但它不起作用。我会将其保存为.txt文件,以便您可以查看它。它将是@……multiform/post.txt 除此之外,我如何发送整个表单,而不是声明“数据”位的所有值: $.ajax({ type: 'POST', url: 'post.php', data: {subject:options.s

我不明白为什么这张表格不发送

代码很长,我不认为把所有内容都发布在这里是个好主意

  • 链接到表单
  • 链接到脚本

    我只是尝试在浏览器中加载PHP文件,但它不起作用。我会将其保存为.txt文件,以便您可以查看它。它将是@……multiform/post.txt

除此之外,我如何发送整个表单,而不是声明“数据”位的所有值:

   $.ajax({
        type: 'POST',
        url: 'post.php',
        data: {subject:options.subject, name:$(this_id_prefix+'#adycustlname').val(),     email:$(this_id_prefix+'#email').val(), message:$(this_id_prefix+'#zip').val()},
        success: function(data){
同样忽略
success:function(data){
部分,这个表单将被放在一个滑动面板中,以便滑动条在之后应该做什么 主要问题是获取要发送的表单

编辑

     $('#submit_seventh').click(function(){

               //send information to server

       $.ajax({
            type: 'POST',
            url: 'post.php',
            data: $('#bob').serialize(),
            success: function(data){
                        $(this_id_prefix+'#loading').css({display:'none'}); 
                        if( data == 'success') {
                            $(this_id_prefix+'#callback').show().append(options.recievedMsg);
                            if(options.hideOnSubmit == true) {
                                //hide the tab after successful submition if requested
                                $(this_id_prefix+'#contactForm').animate({dummy:1}, 2000).animate({"marginLeft": "-=450px"}, "slow");
                                $(this_id_prefix+'div#contactable_inner').animate({dummy:1}, 2000).animate({"marginLeft": "-=447px"}, "slow").animate({"marginLeft": "+=5px"}, "fast"); 
                                $(this_id_prefix+'#overlay').css({display: 'none'});    
                            }
                        } else {
                            $(this_id_prefix+'#callback').show().append(options.notRecievedMsg);
                            setTimeout(function(){
                                $(this_id_prefix+'.holder').show();
                                $(this_id_prefix+'#callback').hide().html('');
                            },2000);
                        }
                    },
  error:function(){
                        $(this_id_prefix+'#loading').css({display:'none'}); 
                        $(this_id_prefix+'#callback').show().append(options.notRecievedMsg);
                                        }
});     




        alert('Data sent');
    });   
        } else return false;  
        alert('Fail');

    });

^^^^^为什么上面的代码不起作用?^^^ ^

在脚本末尾,您必须替换

$('#submit_fourth').click(function(){
    //send information to server
    alert('Data sent');
});

使用正确的URL发送。

您能整理相关代码并将其放在这里吗?读取
数据太长:$(“#yourform”).serialize()
将捕获表单的所有数据。@Mr.J4mes@Marc B,我添加了对
数据的更改:
我还添加了相关的code@powtac@dm03514我不明白,我是否要添加
$.ajax
。+提交发生在
$(“#提交第七次”)。单击..