In which language and what means secure?
For the hints, errors or status messages I currently do the following.
Jquery there I’ll serialize the form fields and send it over to a php file. Where you can parse for errors or validate the form fields if there is an error you can return e.g. in json back those messages to the Jquery script. This can update a div, span or whatever with those messages…
The following link might help:
[Click…](http://net.tutsplus.com/tutorials/html-css-techniques/build-a-neat-html5-powered-contact-form/ “Nettuts Contact Form”)
Ps. But it might not be best practise for a start it can be enough…