Welcome Guest, Not a member yet? Register   Sign In
set_value not working?
#1

[eluser]MTWIGG[/eluser]
I am creating my first form based on the example http://ellislab.com/codeigniter/user-gui...ation.html (my autoload has $autoload['helper'] = array('url'); which is the main difference)

I have just one text field and whilst the validation works, set_value() is not working. The view is...

<?php echo validation_errors(); ?>
<?php echo form_open('forgotten'); ?>
Please enter your email. Your password will be sent to you.<br/>
Email Address: &lt;input type="text" name="email" value="" size="100" value="&lt;?php echo set_value('email'); ?&gt;" /&gt;
<div>&lt;input type="submit" value="Submit" /&gt;&lt;/div>
&lt;/form&gt;

... and the controller is ...

&lt;?php
class Forgotten extends CI_Controller
{
function Forgotten()
{
parent::__construct();
$this->load->helper('form');
}

public function index()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email Address', 'required|valid_email');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('forgotten_body');
}
else
{
$this->load->view('forgottensent_body');
}
}
}
?&gt;


Messages In This Thread
set_value not working? - by El Forum - 07-01-2011, 05:23 AM
set_value not working? - by El Forum - 07-01-2011, 07:18 AM
set_value not working? - by El Forum - 07-01-2011, 07:22 AM
set_value not working? - by El Forum - 07-01-2011, 07:40 AM
set_value not working? - by El Forum - 07-01-2011, 08:02 AM
set_value not working? - by El Forum - 07-01-2011, 08:09 AM
set_value not working? - by El Forum - 07-07-2011, 01:07 AM
set_value not working? - by El Forum - 07-07-2011, 01:35 AM
set_value not working? - by El Forum - 07-07-2011, 02:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB