Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/263.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
Cakephp表单在提交时没有数据_Php_Forms_Cakephp - Fatal编程技术网

Cakephp表单在提交时没有数据

Cakephp表单在提交时没有数据,php,forms,cakephp,Php,Forms,Cakephp,我使用CakePHP1.3填写了一个表单,在调试submit时,我注意到 data:$("#submit-478065271").closest("form").serialize() 是空的。为什么会发生这样的事情?我已经检查了表单是否确实有数据,我可以手动序列化这些数据。以下是提交代码: echo $this->Js->submit( 'Sign up', array( 'class' => 'btn btn_sub

我使用CakePHP1.3填写了一个表单,在调试submit时,我注意到

data:$("#submit-478065271").closest("form").serialize()
是空的。为什么会发生这样的事情?我已经检查了表单是否确实有数据,我可以手动序列化这些数据。以下是提交代码:

echo $this->Js->submit(
        'Sign up',
        array(
            'class' => 'btn btn_submit fr register_submit register_btn_align',
            'url' => array('controller' => 'email_guides', 'action' => 'subscribe'),
            'before' => '$(".error-message").remove();' . $this->Js->get('#loading')->effect(
                'fadeIn',
                array('buffer' => false)
            ),
            'complete' => $this->Js->get('#loading')->effect(
                'fadeOut',
                array('buffer' => false)
            ) . 'debugger;',
            'success' => 'if(data.success) {
                    $("#CustomUserFirstName").val("");
                    $("#CustomUserEmail").val("");
                    $("#EmailGuidesUserStartDate").val("' . date('d/m/Y', strtotime('+1 Weekday')) . '");
                    $("#EmailGuidesUserTerms").attr("checked", false);
                    $("#signupModal").hide();
                } else {

                    $("#signupModal").hide();
                }
            'type' => 'json'
        )
    );
    ?>
    <?php echo $this->Form->end(); ?>
更新:我注意到表单不是submit元素的父元素。。。这很奇怪。这可以解释.ClosesForm返回空数组的原因