Adam Batkin
2010-01-31 20:17:15 UTC
Hi,
I have a use case where it would be good if htmlfill could operate only
on a particular named form (<form name="foo">) and leave any other forms
alone.
For example, if there were two forms on a page, one for logging in (with
a username field) and one for creating a new user (also with a username
field), the filling-in would only touch the one specified.
Attached is a proposed patch that adds this ability. My initial testing
has found that it works pretty well.
It adds an optional argument to htmlfill.render(): form_name
If a form_name is not passed, htmlfill should act exactly the same as
before. If a form_name IS passed however, htmlfill will only ever touch
the named form (plus any unnamed forms, though I'm not sure if this is a
good idea).
Thoughts? Comments? Suggestions?
Thanks,
-Adam Batkin
I have a use case where it would be good if htmlfill could operate only
on a particular named form (<form name="foo">) and leave any other forms
alone.
For example, if there were two forms on a page, one for logging in (with
a username field) and one for creating a new user (also with a username
field), the filling-in would only touch the one specified.
Attached is a proposed patch that adds this ability. My initial testing
has found that it works pretty well.
It adds an optional argument to htmlfill.render(): form_name
If a form_name is not passed, htmlfill should act exactly the same as
before. If a form_name IS passed however, htmlfill will only ever touch
the named form (plus any unnamed forms, though I'm not sure if this is a
good idea).
Thoughts? Comments? Suggestions?
Thanks,
-Adam Batkin