eazyGen Posted September 4, 2011 Share Posted September 4, 2011 Hi guys, What techniques do you use to process, validate, and then show errors on your forms. Do you set an "action" to the same form and then handle errors somewhere? Do you use a separate script to process validation? What standards do you apply for the position of the error messages? Do you alter the "look" of any fields in errors (make them red for example)? Do you have a good standard strategy that can be applied for all forms in a re-usable fashion? Perhaps using functions? I am looking for a robust, user friendly (and coder friendly come to that) solution to this frequently encountered situation. Many thanks for any help. S Quote Link to comment https://forums.phpfreaks.com/topic/246392-form-errror-handling-strategy/ Share on other sites More sharing options...
freelance84 Posted September 4, 2011 Share Posted September 4, 2011 It depends on the size of the form and the function of the form. Typically though i like to use a message at the top of the form telling the user they have missed a field and also mark the field they have missed some how (the style of which depends on the style of the site, and what they missed). Quote Link to comment https://forums.phpfreaks.com/topic/246392-form-errror-handling-strategy/#findComment-1265316 Share on other sites More sharing options...
Pikachu2000 Posted September 4, 2011 Share Posted September 4, 2011 Have a look at the code in this post: http://www.phpfreaks.com/forums/index.php?topic=342869.msg1617526#msg1617526 Quote Link to comment https://forums.phpfreaks.com/topic/246392-form-errror-handling-strategy/#findComment-1265331 Share on other sites More sharing options...
eazyGen Posted September 5, 2011 Author Share Posted September 5, 2011 Thanks guys. But I need to think some more. I am aiming for rigour and consistency for every form, for every data type, and even for more complex business rules. S Quote Link to comment https://forums.phpfreaks.com/topic/246392-form-errror-handling-strategy/#findComment-1265526 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.