Hello Ash,
I would have thought you would use nested fieldsets. The HTML 4 spec
allows for this, and although browsers historically had some
difficulties rendering them, current browsers seem to support it.
Currently if you just have one top level widget, it would end up in a
fieldset thus:
<fieldset>
<input ...>
</fieldset>
So it seems to me that the logical extension of this is that if you
embed 2 other widgets, it should end up like this:
<fieldset>
<input ...>
<fieldset>
<input ...>
</fieldset>
<fieldset>
<input ...>
</fieldset>
</fieldset>
This model would hold to any depth, e.g. with an embedded widget inside
an embedded widget:
<fieldset>
<input ...>
<fieldset>
<input ...>
<fieldset>
<input ...>
</fieldset>
</fieldset>
</fieldset>
Please see attached test.html, which validates.
Regards,
--
Jon
On Thu, 2006-07-06 at 18:57 -0400, Ash Berlin via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=20313 >
>
> This is by design, since the HTML standard says the only thing a form
> can contain is block level elements (div or fieldset mainly) so where
> would you put them?
>
> In another field set? Merged into first one? Before embedded? After?
> etc. etc.
>
> If you can come up with a decent way of specifiying this, and provide
> tests for it then we can implement it.
>
> Thanks,
> Ash Berlin
>
> On Wed Jul 05 22:06:32 2006, guest wrote:
> > HTML-Widget-1.07, Perl 5.8.5, Centos 4 Linux
> >
> > If you have a widget, add some elements, then embed some other forms,
> > the initially added elements fail to be rendered.
> >
> > Example code:
> >
> > ----
> >
> > #! /usr/bin/perl
> >
> > use strict;
> > use warnings;
> > use HTML::Widget;
> >
> > my $w = HTML::Widget->new->method('post')->action('/foo/bar');
> > $w->element( 'Textfield', 'age' )->label('Age')->size(3);
> >
> > my $w2 = HTML::Widget->new('foo')->action('/foo');
> >
> > # Add a standalone element to the containing w2
> > $w2->element( 'Textfield', 'allbymyself' )->label('All By
> Myself')->size(3);
> >
> > #print $w2->process . "\n\n";
> >
> > my $w3 = HTML::Widget->new('bar');
> > $w3->element( 'Textfield', 'baz' );
> >
> > $w2->embed($w);
> > $w2->embed($w3);
> >
> > my $f = $w2->process;
> >
> > print $f;
> >
> > ---
> >
> > Example output:
> >
> > <form action="/foo" id="foo" method="post"><fieldset
> > id="foo_widget"><label for="foo_widget_age"
> > id="foo_widget_age_label">Age<input class="textfield"
> > id="foo_widget_age" name="age" size="3" type="text"
> > /></label></fieldset><fieldset id="foo_bar"><input class="textfield"
> > id="foo_bar_baz" name="baz" type="text" /></fieldset></form>
> >
> > Note the absence of the 'allbymyself' element.
> >
> >
>
>