Zope-like html-forms and required, disappearing values serverside in plain python
Thomas Weholt
2002 at weholt.org
Wed Jan 29 05:34:40 EST 2003
Or : how to get empty form-fields in a posted html-form?
NB! I'm using BaseHTTPServer as server in my project.
I'm trying to implement something similar to Zopes html-forms:
<form ....>
<input type="text" name="name:string:required">
<input type="text" name="age:int">
...
</form>
This way we can parse the posted data server side into real python
datatypes, values intended as integers are available as integers, not as
string.atoi(age[0]) etc. The problem is that empty fields are not available
serverside, in the posted data. They just disapear. How can I use this
method and still get access to empty fields, so the required-tag makes
sense? My previous solution used a second input-field, a hidden one,
specifiying required fields, but Zope don't.
Any hint on this problem would be appreciated.
Best regards,
Thomas
More information about the Python-list
mailing list