CodeIgniter Forums
Validation Errors not showing - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Validation Errors not showing (/showthread.php?tid=13594)



Validation Errors not showing - El Forum - 11-28-2008

[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!


Validation Errors not showing - El Forum - 11-29-2008

[eluser]Aidy[/eluser]
I have solved my problem. I have been working on a live server. And somewhere along the line I have deleted the controller then created it again but renamed with a capital letter by mistake. I uploaded the file thinking it would overwrite. I'm sure you can work out the rest!!

Very sorry if I have wasted anyones time :red: