My current job title is "Web Developer." I develop web applications, and I generally enjoy it quite a bit. But the applications that I work with on a daily basis tend to include forms. Yuck. We have talked about it time and again in the office, and I have scoured the web for an elegent way to deal with them.
We've tried Pear's QuickForm package, and it's okay for simple forms, but having full control over each element just isn't possible. QuickForm takes the approch of generating the markup and adding validation rules with php code. That is you never write html when creating such a form, it does it for you. Sometimes you really just need to write you own markup.
A while back I came across this article that outlined a pretty neat way to deal with it. I really like the idea of including the rules in the markup and have php use those rules to validate the form. This particular implemenation adds a bunch of tags and elements in the html, which just doesn't sit right with me.
So what if we could use completely standard markup, yet still include these validation rules in it. If only there was a language that described forms this richly... Enter XForms. XForms has all that built in. What if we could write an XForm, have php (or your language of choice) parse it AND use the built in rules to validate it on submit? For now, we'd have to have php spit out old-style html forms that correspond to the structure in the XForm... but we'd be ready for the future, and someday we'd be able to take out that part and just send the XForm.
I think I'll familiarize myself a bit more with the XForms recomendations and outline a library to do this. Thoughts?