A function for converting forms to HTML friendly strings

Hi,
I cloned you repo and saw I was missing something and I implemented it.
Feel free to merge if found suitable.
Cheers,
jcb!