HTML5模式在一次无效输入后无法接受

时间:2016-10-19 09:29:58

标签: angularjs html5

我在angularJS应用程序中使用html5模式,在页面加载后如果我输入有效输入它工作正常,如果我输入无效输入它通知错误,但之后它不会接受任何值。它在有效和无效输入上都显示错误。

以下是我正在使用的代码。

In my code I am passing id through `/users/home?id=<?php echo $alldatas[$s]['users']['id'];?>` where `users` is a controller and `home` is a method inside the controller. So i have written like that but when i am clicking the id i am getting the error as 

`Warning (2): Missing argument 1 for UsersController::home() [APP\Controller\UsersController.php, line 228]`

View page is index.php

    <td><a href="users/home?id=<?php echo $alldatas[$s]['users']['id'];?>" style="color:#1E6FAA; id='usid' "><?php echo $alldatas[$s]['users']['id'];?></a></td> 

Controller page is UsersController.php

    <?php
    App::uses('CakeEmail', 'Network/Email');
    class UsersController extends AppController
    {


    public function home($id) 
     {

        //$allHome = $this->User->query("select * from users order by id desc"); 
        $allHome = $this->User->query("select * from users where id = $id");       
        $this->set('userDatas',$allHome);

     }

    }

    ?>

请看看并帮我解决这个问题。感谢

1 个答案:

答案 0 :(得分:0)

尝试在您的输入代码中添加以下代码:

oninput="this.setCustomValidity('')"