Welcome Guest, Not a member yet? Register   Sign In
Form validation required not firing
#5

(05-05-2018, 02:24 AM)jreklund Wrote: You need to read the tutorial again, now you got two RUN() functions.
Start fresh and just copy that code before you try to introduce your code.

same, I introduced a single function, but it still does not block when the fields are empty

Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Login_controller extends CI_Controller {

    public function index()
    {
        echo 'welcome to login';
    }

    function login_pro()
    {
        /*echo $user = $this->input->post('user');
        echo $pass = $this->input->post('pass');*/

        $this->form_validation->set_rules('Username','Username','required');
       
        $this->form_validation->set_rules('Password','Password','required');

          if ($this->form_validation->run() == FALSE)
               {
                       echo 'try again';
               }
               else
               {
                       echo 'welcome';
               }
    }
}
Reply


Messages In This Thread
Form validation required not firing - by rachidE - 05-04-2018, 09:20 AM
RE: Form validation required not firing - by rachidE - 05-05-2018, 03:51 AM
RE: Form validation required not firing - by qury - 05-08-2018, 05:08 AM
RE: Form validation required not firing - by qury - 05-08-2018, 08:24 AM
RE: Form validation required not firing - by qury - 05-09-2018, 05:42 AM
RE: Form validation required not firing - by qury - 05-09-2018, 12:01 PM
RE: Form validation required not firing - by qury - 05-10-2018, 06:22 AM
RE: Form validation required not firing - by qury - 05-10-2018, 12:58 PM
RE: Form validation required not firing - by qury - 05-11-2018, 03:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB