Seems like a work around would be to just give the fields different
names right? If they are named do_this and do_that then they either
have a value or they do not.  Another solution would be to only fill
the fields and not the submit buttons, that isn't always possible
though depending on your layout.

I think formencode tries to avoid the problem of assuming that the
order of the fields is correct.  Apparently htmlfill does too.  Is
there documentation that says what really happens ?

I'm sure there are weird cases where people would want to fill submit,
reset or button fields so I'm not sure removing the functionality is
the right thing to do.

I think you could try to avoid this by removing the values from the
defaults dictionary but then htmlfill will probably strip the value
unless you have force_defaults=False.  I think what is definately
needed is a dictionary of fields you do NOT want htmlfill to apply its
force_defaults behaviour.  Then you could remove action from the
defaults and put action in the leave_defaults lookup so htmlfill just
ignores it.



On Sat, Feb 27, 2010 at 10:19 AM, Jonathan Vanasco
<[email protected]> wrote:
> this is annoying.
>
> lets say that you have mutiple submit buttons:
>
>  input type="submit" name="action" value="do_this"
>  input type="submit" name="action" value="do_that"
>
> if formencode/validate catches an error on the form, all "action" will
> become the clicked value.
>
> htmlfill.render should ignore type="submit" buttons by default, or at
> least give that option
>
> there's absolutely no reason to force a render of a form that
> collapses mutiple options into one.  all other form fields are
> editable.
>
> formencode htmlfill.py
> 398-403
>        elif t == 'submit' or t == 'reset' or t == 'button':
>            self.set_attr(attrs, 'value', value or
>                          self.get_attr(attrs, 'value', ''))
>            self.write_tag('input', attrs, startend)
>            self.skip_next = True
>            self.add_key(name)
>
> should be
>        elif t == 'submit' or t == 'reset' or t == 'button':
>            pass
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to