Welcome Guest, Not a member yet? Register   Sign In
Pre-populated inputs and validation
#6

[eluser]smith[/eluser]
Put one hidden field to your form, for example "marker" and give it value=1.
So, now, when your form is displayed for the first time marker is "0". when your form is submited marker value is "1".
Second, try this:
if you are repopulating form from the database:
Code:
$sql = "SELECT some_field from some_table";
$query = $this->db->query($sql);
$row = $query->row();
$this->validation->some_field = $row->some_field;

so, when you want to populate the form, marker will be having value "0". you can use it in your IF's. when the form is submited you will be using values from the form, so you will not execute sql query and change $this->validation->some_field value.


Messages In This Thread
Pre-populated inputs and validation - by El Forum - 08-14-2007, 06:32 AM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 09:31 AM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 09:37 AM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 09:45 AM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 10:06 AM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 03:25 PM
Pre-populated inputs and validation - by El Forum - 08-14-2007, 04:28 PM
Pre-populated inputs and validation - by El Forum - 08-17-2007, 09:29 AM
Pre-populated inputs and validation - by El Forum - 08-18-2007, 05:05 PM
Pre-populated inputs and validation - by El Forum - 10-20-2007, 12:03 PM
Pre-populated inputs and validation - by El Forum - 10-22-2007, 12:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB