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

(05-08-2018, 08:24 AM)qury Wrote:
(05-08-2018, 06:03 AM)rachidE Wrote: I've already done that,  but without success

OK!
I've taken the code you have pasted in and created a brand new installation of CI 3.1.8

In order to get this thing working i had to do 2 changes to your code:

1, in the form i've changed base_url() to site_url()
2, see the example class

PHP Code:
<?php
class Test extends CI_Controller {

 
   public function __construct() {
 
       parent::__construct();
 
       // Loading helpers and library
 
       $this->load->helper(array('form''url'));
 
       $this->load->library('form_validation');
 
   }

 
   function login_pro() {

 
       $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';
 
       }
 
   }




Now, this is working fine on linux on PHP 7.2.5

Personally i do not like the case sensitive name tags in the form, so if it would be up to me u would rename Username to username, but that is just my preference..


hello,

I did what you suggested, but it still does not work.
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 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 rachidE - 05-09-2018, 02:40 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