Subject: | Invalid nesting of <div> and <fieldset> tags |
Date: | Sun, 23 Mar 2008 00:19:50 -0400 |
To: | bug-CGI-FormBuilder [...] rt.cpan.org |
From: | Jason Blevins <jrblevin [...] sdf.lonestar.org> |
CGI::FormBuilder v3.0501 generates improperly nested div and fieldset
tags (and thus invalid XHTML) in some cases. The following code
illustrates this behavior:
use CGI::FormBuilder;
my $form = CGI::FormBuilder->new(template => {type => 'div'});
$form->field(name => "foo", fieldset => "bar");
print $form->render();
The resulting XHTML follows. Notice the <fieldset> should be closed before
the <div> which contains it.
<!-- Generated by CGI::FormBuilder v3.0501 available from www.formbuilder.org -->
<form action="form.pl" method="get">
<div><input id="_submitted" name="_submitted" type="hidden" value="1" /></div>
<div>
<fieldset>
<legend>bar</legend>
<div>
<div>Foo</div>
<div><input id="foo" name="foo" type="text" /></div>
</div>
</div>
</fieldset>
<div>
<div>
<div align="center"><input id="_submit" name="_submit" type="submit" value="Submit" /></div>
</div>
</div>
</form>