Hi I have a question which have bothered me for a while - thats to do the validation when a form is submittted:
How can validation be done in the best way? I have come on the alternatives:
1- making the validation in the php after submitting the form
--> then you handle in the server level, but would the data that the user enters still exist when you make a header(location to the same page (probably globals)
--> how would the error messages be handled - would you redirect to a totally new page or the same the user came from?
2 - Using Javascript.
--> This I like because you directly apply messages at the instance data is entered.
--> But this is Client side - so its not a REAL validation.
I like the usability of 2) and the consistency of 1)
But what is the best practice of 1) still having a good user experience???
Im pretty new in PHP/Javascript and web development and do not want to start in a wron direction....
thanks,
Serap