Closed GoogleCodeExporter closed 9 years ago
Thanks for the bug report. I was able to recreate this issue and be providing
a patch in the next few days (hopefully today).
- Andrew
Original comment by ajporterfield@gmail.com
on 15 Sep 2012 at 1:42
Which web browser are you using? In Firefox on Mac, the required HTML5
attribute applies validation to each checkbox in the group - meaning you would
get an error if any of the checkboxes were left unchecked.
With radio buttons, the required attribute applies to the group and not each
radio button - meaning you would get an error only if all radio button were
left unchecked.
Are you seeing the same behavior in your browser?
- Andrew
Original comment by ajporterfield@gmail.com
on 15 Sep 2012 at 2:05
The fix for this issue is to edit PFBC/Element/Checkbox.php. Near the bottom
of the render method, you'll see a line within the for loop echoing each
option's label and input tag. In that line, the getAttributes method is
called. That method call currently look like this...
$this->getAttributes(array("id", "value", "checked"))
You need to update it to include "required" in the array. The final result
looks like this...
$this->getAttributes(array("id", "value", "checked", "required"))
This will prevent the required HTML5 attribute from being added to the input
tag.
- Andrew
Original comment by ajporterfield@gmail.com
on 15 Sep 2012 at 5:29
And then pfbc will validate correctly server side right?
Original comment by mor...@gmail.com
on 16 Sep 2012 at 12:37
Yep, you got it. The latest revision (r570) contains a fix for this bug. So,
if you don't want to manually edit the source, you can just export the
project's trunk with...
svn export http://php-form-builder-class.googlecode.com/svn/trunk/
pfbc3.0-php5.3
- Andrew
Original comment by ajporterfield@gmail.com
on 16 Sep 2012 at 3:13
Original issue reported on code.google.com by
mo...@rustybrick.com
on 14 Sep 2012 at 5:49