[html-formfu] Possible bug - Submit element when forms have errors

Carl Franks fireartist at gmail.com
Thu Feb 19 09:39:06 GMT 2009


2009/2/18 David Dorward <david at dorward.me.uk>:
> Carl Franks wrote:
>>
>> Then your code would change from checking the submitted value, to
>> checking which name was sent:
>>    if ( $form->param('save') ) { }
>>    elsif ( $form->param('finish') ) { }
>>    # etc..
>
> That would work, but I'd consider it to be a hack.

Them's fightin' words ;)

> Having multiple buttons with the same name is an accepted means to pick one
> of a number of values while submitting a form.

I wouldn't consider it an acceptable way of doing it, because submit
buttons unfortunately use the 'value' attribute as the text to display
to the user.
So if you build your program logic based on those values, and then get
asked to add support for multiple languages to the application, you're
rather up the creek.
If however you use different names, and don't worry about checking
what value was submitted, you don't have those issues.

Cheers,
Carl



More information about the HTML-FormFu mailing list