Welcome Guest, Not a member yet? Register   Sign In
Using Validation on a 'Edit' screen
#1

[eluser]Unknown[/eluser]
OK, so I have set up the validation helper perfectly on my 'Add new entry' page and it works great.

Now I'm building the 'Edit entry' page and can't figure out how to combine the validation helper with pre-populating the form with the saved data.

Using the form helper I need to populate the inputs like this:

Code:
// Scheme name
$this->table->add_row(
    array(
        form_label('Scheme name', 's_name').NBS.form_error('s_name'),
        form_input(
            array(
            'id'    => 's_name',
            'name'    => 's_name',
            'class' => 'field',
            'value' => $scheme->s_name
            )
        )
    )
);

But without the:

Code:
'value' => set_value('s_name')

bit, how will the validation work?

Am I missing something obvious?

Many thanks,

Malcolm


Messages In This Thread
Using Validation on a 'Edit' screen - by El Forum - 08-06-2010, 11:18 AM
Using Validation on a 'Edit' screen - by El Forum - 08-07-2010, 03:01 AM
Using Validation on a 'Edit' screen - by El Forum - 08-16-2010, 03:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB