Ian Bicking: the old part of his blog

Re: A theory on form toolkits

I love FormEncode--it's be best concept of a form validation tookit I've ever seen. However, in all of the tutorials and examples I've seen the actual form markup is maintained as a string that is not part of the page template (it gets inserted into the template later). I don't like that. I want to have all my form markup reside in the template (I'm using SimpleTAL), and process the template with htmlfill after the template is expanded. I realize that there may be a limitation of one form per page (or at least every input tag must be uniquely named on each page).

Comment: htmlfill must happen after the template is expanded because sometimes input tags are generated by the templating system. If htmlfill happened first these tags would not exist.

Bottom line: I'm running into problems with SimpleTAL stripping the markup out of my <form:error name="fieldName" /> tags--after SimpleTAL expansion they look like this: <form>. That won't do. Is there a workaround or planned solution to this problem?

Comment on A theory on form toolkits


Sorry, forgot to include my name...

# Daniel Miller

OK. I found the solution. Duh ... declare "form" as an XML namespace. Like this:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:form="http://www.formencode.org">

That's all it took. Thanks for providing a space for me to think out loud Ian.

# Daniel