[Html-widget] default action is '/' ??
John Napiorkowski
jjn1056 at yahoo.com
Wed Aug 30 22:28:22 CEST 2006
Hmm, look at the source code, now why didn't I think of that. That's what happens when I try to give up coffee :)
In the docs for 1.08 it says:
$self->action($action) Get/Set the action associated with the form. The default is no action, which causes browsers to submit to the current URI.
I would argue that a sane default is as the documentation suggestions. More than 90% of the time that is exactly the behavior I want.
Additionally, the way it's right now I can't see how to even force it to have no action. I'd send a patch for this but it's a big change, what do people think?
--john
----- Original Message ----
From: Jason Kohles <email at jasonkohles.com>
To: John Napiorkowski <jjn1056 at yahoo.com>; html-widget at lists.rawmode.org
Sent: Wednesday, August 30, 2006 3:16:06 PM
Subject: Re: [Html-widget] default action is '/' ??
On 8/30/06, John Napiorkowski <jjn1056 at yahoo.com> wrote:
> Hi,
>
> The documentation specifies that the default action to a from is nothing to make it easier to create self referring forms. However everything I do causes an action to be set to "/" in my generated forms. Is this just a documentation error and if so what are people doing to make self referring forms? I'm going crazy trying to deal with this :)
>
I don't see where in the documentation that says this, but the code
contains (in HTML::Widget::process):
# Some sane defaults
if ( $self->container eq 'form' ) {
$self->attributes->{action} ||= '/';
$self->attributes->{method} ||= 'post';
}
Which would seem to imply that you won't get that behaviour if your
elements are in a fieldset. Although personally I would argue with
whoever wrote that code that setting / as the default action hardly
qualifies as sane. :)
--
Jason Kohles
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
More information about the Html-widget
mailing list