Welcome Guest, Not a member yet? Register   Sign In
error on form view, trying to display validation_errors()
#2

[eluser]CodeIgniterNoob[/eluser]
The form:

Code:
<html>
<head>
<title>My Form</title>
</head>
<body>

<?php echo validation_errors(); ?>

<?php echo form_open('form'); ?>

<h5>Username</h5>
&lt;input type="text" name="username" value="" size="50" /&gt;

<h5>Password</h5>
&lt;input type="text" name="password" value="" size="50" /&gt;

<h5>Password Confirm</h5>
&lt;input type="text" name="passconf" value="" size="50" /&gt;

<h5>Email Address</h5>
&lt;input type="text" name="email" value="" size="50" /&gt;

<div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;


Success page:
Code:
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;My Form&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

<h3>Your form was successfully submitted!</h3>

<p>&lt;?php echo anchor('form', 'Try it again!'); ?&gt;</p>

&lt;/body&gt;
&lt;/html&gt;

Controller:

Code:
&lt;?php

class Form extends Controller {
    
    function index()
    {
        $this->load->helper(array('form', 'url'));
        
        $this->load->library('form_validation');
                
        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('myform');
        }
        else
        {
            $this->load->view('formsuccess');
        }
    }
}
?&gt;

Just like in the online manual. http://www.ellislab.com/codeigniter/user...ation.html

And I still get the error on my form page.
Fatal error: Call to undefined function validation_errors() in /.../.../.../.../system/application/views/form.php on line 3

Even on my own validation errors I get this error "Call to undefined function form_error()" I bet its something really small that Im forgetting to do...


Messages In This Thread
error on form view, trying to display validation_errors() - by El Forum - 01-10-2009, 03:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB