douping3860 2014-04-20 08:59
浏览 82
已采纳

Yii ajax表单验证没有提交

Hi have the following form declared in a layout:

<?php
$regModel = new RegistrationForm();

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'registration-form',
    'action' => Yii::app()->createUrl('/utente/sign'),
    'type' => 'inline',
    'enableAjaxValidation' => true,
    'clientOptions'=>array(
        'validateOnChange'=>true,  
        'validateOnType'=>true,
        'validationDelay'=>10,
    ),
));

?>

the problem is that I don't receive any request on my controller. I tried to monitor the Network Console but I don't see any request as I type in my form.

Network

I'm using ajax validation on many other forms in my application and they are working as expected.

Any idea why this is not working?


SOLUTION Turned out that jQuery was registered twice. The first time by Yii and the second time by my template. Once it was removed from my template everything started working as expected.

  • 写回答

1条回答 默认 最新

  • dongshen2903 2014-04-20 18:13
    关注

    Check this Yii Ajax Validation

    Hope this would help.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败