Zebra_Form, a jQuery free PHP library, handles this process very well and enables us to create secure and chic forms with a few lines of PHP code.
The output can be generated either with the ready-to-use styles (with valid HTML) or with any new/custom ones.
Zebra_Form is a PHP class that simplifies the process of creating and validating HTML forms. Its object-oriented structure promotes rapid HTML forms development and encourages developers to write clean and easily maintainable code. It frees the developers from the repetitive task of writing the code for validating forms by offering powerful built-in client-side and server-side validation.
Zebra_Form has an integrated cross-site scripting prevention mechanism that automatically strips out potentially malicious code from the submitted data. It also prevents automated SPAM posts, out of the box and without relying on CAPTCHA by using honey pots.
Output can be generated either automatically or manually through templates (basic PHP files). When generated automatically, the generated output validates as HTML 4.01 Strict or XHTML 1.0 Strict and has the same look & feel across all major browsers like Firefox, Chrome, Opera, Safari, Internet Explorer (yes, IE 6, too).
It provides all the controls you’d expect in an HTML form and, additionally, date/time pickers, captcha and AJAX-like file upload controls.
The client-side validation is based on jQuery 1.5.2+
PHP Library For HTML Forms
Requirements: PHP 4.4.9+, jQuery 1.5.2+
Compatibility: All Major Browsers
Website: http://stefangabos.ro/php-libraries/zebra-form/
Demo: http://stefangabos.ro/wp-content/demos/Zebra_Form/