Welcome Guest, Not a member yet? Register   Sign In
set_value method with edit form
#1

[eluser]iConTM[/eluser]
For a backend I'm using CIs formvalidation methods:

Code:
<input type="text" name="email" value="<?php echo set_value('email'); ?>" />

When a user wants to edit a record, the value of the inputfield above must be filled in with data from the database.

How can I determine which data the set_value method returns?

Any ideas?
#2

[eluser]Bart v B[/eluser]
First you retreve youre records from your database and then you just fill it.
Code:
<?php
foreach($rows as $row)
{
  echo '<input type="text" name="email" value="'.set_value($row->email).'" /> ';
}

?>
#3

[eluser]iConTM[/eluser]
the set_value requires the name of the inputfield Confused
#4

[eluser]iConTM[/eluser]
ah found it!

Code:
<input type="text" name="quantity" value="<?php echo set_value('quantity', '0'); ?>" size="50" />

where '0' is the default value




Theme © iAndrew 2016 - Forum software by © MyBB