Welcome Guest, Not a member yet? Register   Sign In
Validation Errors not showing
#1

[eluser]Aidy[/eluser]
Hello,

I have put a bit of code together following the guide on form validation. The problem I am having is any form error messages from validation_errors(); are not showing.

Here is the code for the controller.

Code:
class Player extends Controller {

    function Player()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $this->load->view('player');
    }
    
    function signup()
    {
        $this->load->helper(array('form', 'url'));
        
        $this->load->library('form_validation');
        
        $this->form_validation->set_rules('first_name', 'First Name', 'required');
                
        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('player/signup');
        }
        else
        {
            $this->load->view('formsuccess');
        }
    }
}

And here is the code for the view 'player/signup'

Code:
<?php echo validation_errors(); ?>

<?php echo form_open('player/signup'); ?>

<fieldset>

<legend>Personal Details</legend>

<p>
  <label for="first_name">First Name</label>
  &lt;input type="text" maxlength="30" name="first_name" value="&lt;?php echo set_value('first_name'); ?&gt;"/&gt;
</p>

<p>
  <label for="middle_name">Middle Name</label>
  &lt;input type="text" maxlength="30" name="middle_name"/&gt;
</p>

<p>
  <label for="last_name">Last Name</label>
  &lt;input type="text" maxlength="30" name="last_name"/&gt;
</p>

Can anyone point out how I am going wrong?

Cheers!


Messages In This Thread
Validation Errors not showing - by El Forum - 11-28-2008, 10:43 AM
Validation Errors not showing - by El Forum - 11-29-2008, 05:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB