Welcome Guest, Not a member yet? Register   Sign In
validation dont't show message
#11

[eluser]cindor[/eluser]
[quote author="kiyo" date="1243589529"]thank you very much
I write code from guideline

new screenshot << validate error don't show mesage

I change a little in controller/register.php
Code:
class Register Extends Controller{
        function _construct() { // for php5

        $this->load->library('form_validation');
        $this->load->helper('form');

    }
        
        function index(){
            $data["head"] = "register new user";
            $data["title"] = "form register new user";
            $data["meta"] = "register form ";
            $this->load->view("register_view",$data);
        }
        
        function register_process(){
           $data["head"] = "register new user";
            $data["title"] = "form register error";
            $data["meta"] = "register form ";
            $this->form_validation->set_rules("username","username","required|min_length[5]");
            

            
            if($this->form_validation->run() == false){
                
                $this->load->view("register_view",$data);
            }else{
                
                echo "complete";
            }
        }
}

and this is a view/register_process.php
Code:
&lt;?php echo var_dump(validation_errors()); ?&gt; //try to dump data but it empty ,why?

&lt;?=form_open("register/register_process")?&gt;

<table width="360" border="0" cellspacing="0" cellpadding="1">
  <tr>
    <td width="179"><div align="right">username</div></td>
    <td width="177">&lt;input name="username" type="text" id="username" value ="&lt;?=set_value("username","1")?&gt;"/&gt;&lt;/td>
  </tr>

  <tr>
    <td>&lt;input type="submit" name="Submit" value="Submit" /&gt;&lt;/td>
    <td>&nbsp;</td>
  </tr>
</table>
&lt;?=form_close()?&gt;
[/quote]

i guess you are mixing views... in the controller "register_view" is loaded, but you show "register_process" view.


Messages In This Thread
validation dont't show message - by El Forum - 05-28-2009, 10:33 AM
validation dont't show message - by El Forum - 05-28-2009, 11:27 AM
validation dont't show message - by El Forum - 05-28-2009, 08:17 PM
validation dont't show message - by El Forum - 05-28-2009, 08:38 PM
validation dont't show message - by El Forum - 05-28-2009, 09:36 PM
validation dont't show message - by El Forum - 05-28-2009, 10:32 PM
validation dont't show message - by El Forum - 05-28-2009, 10:40 PM
validation dont't show message - by El Forum - 05-28-2009, 10:54 PM
validation dont't show message - by El Forum - 05-29-2009, 01:58 AM
validation dont't show message - by El Forum - 05-29-2009, 06:27 AM
validation dont't show message - by El Forum - 05-29-2009, 07:10 AM
validation dont't show message - by El Forum - 06-05-2009, 04:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB