I have updated Formed, my PHP HTML Form Generator, to provide support for errors. The functionality is there, but I have not updated the tutorial yet to cover error handling. Setting errors is actually as easy as calling the set_errors method of the Formed object and telling it what errors you want to set. Below is a simple example:
1 | $myForm->set_errors (array ("Comment" => array ("You must provide a comment!", "The comment field must be at least 10 characters!"))) ; |
This example shows setting 2 different error messages for the comments field element. That’s all there is to it. The DefaultTemplate and the black_and_white template were updated to incorporate the tags needed for processing errors. The others will be updated as time permits. You can make the edits yourself if needed sooner by following the example in black_and_white. I’m excited about this new feature and I have already used the functionality in my Your Brain site.
On a related note I always like to give a shout out where it is warranted. Although I have not used it, the PHPForms product looks pretty nice if you need to render static HTML forms. Although this is not the goal of Formed, I still think their form builder implementation is intuitive and well done. If you need to develop static forms you should give them a look. If you need to generate dynamic forms in your code then Formed may be more appropriate for your project.

