Example: User Friendly error message

An example of how to write more UserFriendly error messages…

if(floatval($this->get()) != $this->get())

{

return “Invalid numeric value

(example:

“.str_repeat(“1″,$this->length).”,

“.str_repeat(“5″,$this->fl_point).”

).”;

}

This just throws an idea in my mind that doing more good examples is the best validation that keeps working in the mind of our users. So the users see the example and he got the idea. This will work best ‘cos in most cases it skips the “good description” definition in the message… so on the same idea…here are 2 examples of the message before and now:

Invalid numeric value (example $10,12)

…or before:

Invalid value supplied for this field. Please type valid currency value.

As you see, the old example has alot of description, but I dont think it is the best one :)

No comments yet.

Leave a Reply

blog comments powered by Disqus