Welcome Guest, Not a member yet? Register   Sign In
best practice with form,validation,error,success,action order
#1

[eluser]sikkle[/eluser]
Hi to this community again Smile

i just want to advise, this is maybe a stupid one but let's go.

We all know, a lot of our work consist to manage the input data, show form, error, validation etc. etc.

so i'm trying to figure what is barely the best practice if i give you this example :

You get a controller, we will call it MyLovelyController.php.

indeed we get the same structure as usual, constructor, index.

imagine this controller is just to do this :

show a form to be fill out by the user, let imagine like old good example, this describe a car.

So

field :

Model (select comin from db model indeed)
Color
Motorhp


So we have to show the form, do the validation, re-show the form with current data until the validation as been accepted And after show a little success bouton to do any action, maybe continu, maybe getback now whatever.


So we get back to our controller :

what is the best practice order, i mean


if data in form, do the validation ?


if validation fail
show error
reload view ?

Else

show the blank form ?

else again

show the success form ?



I know it's not the way to go, but this is a example of what i'm looking for.

someone could be kind enough to give a good explaination of barely best practice with form,validation,error,success,action order ?

Many thanks for this again Smile


Messages In This Thread
best practice with form,validation,error,success,action order - by El Forum - 08-20-2007, 09:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB