FAQ

I'm wanting to find (or make) a module that will take a HTML file, locate the
input-related form tags (<INPUT, <TEXTAREA, <SELECT, <OPTION) and modify
them...

Here's a sample that parses some HTML and handles some form elements,
refilling them on POST-back:
http://flangy.com/dev/tinkertoys/ultraform.py
(Source: http://flangy.com/dev/tinkertoys/ultraform.py?viewsource=1 )

But unfortunately... it uses "special tags" for the forms (the t.whatever
tags.)
It would probably be easy enough to modify it to look for the regular form
tag names instead.
I specifically went with special tags because I wanted to abstract a control
from the HTML used to implement it.

I'm using the standard module sgmllib as the parser. Feel free to take the
code and run with it.
(Note that production could will want to be a lot more thorough about
cgi.escape'ing data that's taken from the form and written back out to the
page.)

Take care,
Adam Vandenberg
http://flangy.com

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 12 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedApr 17, '03 at 2:39a
activeApr 17, '03 at 7:59p
posts12
users9
websitepython.org

People

Translate

site design / logo © 2022 Grokbase