Welcome Guest, Not a member yet? Register   Sign In
Form validation question
#3

[eluser]Michael Wales[/eluser]
Make your form action the same method that displays the form. Place all of your validation in that form and then use the run() method of the Validation class to determine whether you need to perform a database insert or not.

Code:
if ($this->validation->run()) {
  // Form was submitted and validated - insert content
  // I like to do a redirect after database queries (so a refresh doesn't submit the data again)
} else {
  // Form wasn't submitted - or it doesn't validate
  // Load a view file
}


Messages In This Thread
Form validation question - by El Forum - 11-10-2007, 03:18 PM
Form validation question - by El Forum - 11-10-2007, 07:14 PM
Form validation question - by El Forum - 11-10-2007, 11:54 PM
Form validation question - by El Forum - 11-11-2007, 03:05 AM
Form validation question - by El Forum - 11-11-2007, 03:28 AM
Form validation question - by El Forum - 11-11-2007, 03:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB