Subject: | field type Upload shows required errors twice |
If a field type 'Upload' fails it's require, it returns the error twice
if using HTML::FormHandler::Render::Table (otherwise it doesn't).
<div class="error"><label class="label" for="my_file">My file: </
Show quoted text
label><input type="file" name="my_file" id="my_file"/>
<span class="error_message">My file field is required</span></div>
<span class="error_message">My file field is required</span></td></tr>
That is the html that it gives me. As you can see, it is using div tags
when it should not be (using Render::Table). It does not use div tags
on any of the other fields.
The <div> tags are being inserted by
HTML::FormHandler::Widget::Wrapper::Simple
Editing out line 43 in HTML::FormHandler::Widget::Wrapper::Simple seems
to fix the problem ($output .= qq{\n<span class="error_message">$_</
Show quoted textspan>} for $result->all_errors;)
However, I do not believe this is the solution, because it still puts
div tags around the upload field, as can be seen by the html produced
when I comment out the line I mentioned above:
<div class="error"><label class="label" for="my_file">My file: </
Show quoted textlabel><input type="file" name="my_file" id="my_file"/></div>
<span class="error_message">My file field is required</span></td></tr>
This is all the information I could come up with.