Welcome Guest, Not a member yet? Register   Sign In
set_value i think
#1

[eluser]Funky Fresh[/eluser]
Hey All,

In my view i have the following code.

Code:
$listname = array(
    'name'    => 'listname',
    'id'    => 'listname',
    'value'    =>    set_value('listname'),
    'maxlength'    => 255,
    'size'    => 60,
);
$fromname = array(
    'name'    => 'fromname',
    'id'    => 'fromname',
    'value'    => set_value('fromname'),
    'maxlength'    => 255,
    'size'    => 60,
);

Then below i have the following

Code:
<td>&lt;?php echo form_input($listname); ?&gt;</td>
<td>&lt;?php echo form_input($fromname); ?&gt;</td>

When i hit submit i have other fields in the form that need validation, but i dont want these to have any, so how do i get them to return the values to the fields when one of the other fields has errors?

Do i still have to add the form_validation stuff in the controller?

just without any actual values like so

Code:
$this->form_validation->set_rules('fromname', 'From Name');

Cheers,
#2

[eluser]farinspace[/eluser]
I usually do the following:

Code:
$this->form_validation->set_rules('fromname', 'From Name','optional');

CI ignores the "optional" rule (or any other rule it doesn't recognize) ...




Theme © iAndrew 2016 - Forum software by © MyBB