Welcome Guest, Not a member yet? Register   Sign In
form validation on detail screen
#7

(05-11-2016, 12:48 PM)cartalot Wrote:
(05-11-2016, 10:45 AM)CINewb Wrote: Here's how I am doing it:

@CINewb this is interesting but i'm not understanding what is going to happen if the form fails validation? Lets say this is a product form with 30 fields - the admin is editing an existing product - they have changed 20 of the fields, but one of the changes fails validation - so we need to show the form again. We don't want to show them the original values from the database because then they lose all the work that they just did on those 20 fields. Or is there something i'm missing?

Yes, set_value('name', $product->name) will display whatever work they did in the input field called "name", when the form is posted.  It will only show the $product->name (which comes from the database) when the form is first displayed, before it is submitted.  So it should do exactly what you have said above.
Reply


Messages In This Thread
RE: form validation on detail screen - by CINewb - 05-11-2016, 10:45 AM
RE: form validation on detail screen - by CINewb - 05-11-2016, 01:42 PM
RE: form validation on detail screen - by CINewb - 05-12-2016, 12:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB