newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Visual Display for multiple errors #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Set multiple fields to be required, or email formatted and submit the form 
without completing those fields. 

What is the expected output? What do you see instead?
Only 1 field will be given as an error. I will have focus, but if it is off the 
screen it will not bee seen. The page is scrolled up to the error box at the 
top of the page. If it is a hidden element then it is also not made visible (I 
don't have an easy answer to that one).

Please provide any additional information below.
I'd like to see the multiple fields that have failed the input test be 
highlighted in some manner. Specifically I'd like the DIV element containing 
the label and input items to have an error / warning class added that could be 
styled (and by reference it's child elements) by css rules ie
.warning{ background-color: #ffcccc;}
.warning label{ color: #ff000;}
.warning input{ border: solid 1px #ff000;}

Secondly I think this would possibly eliminate the need for the current error 
box. As this box doesn't give very much information to the user. Perhaps 
replace the current scroll up and show box interaction with a simpler 
modal/light box error message.

I think that this will be a valuable update as it will a) save multiple 
submissions to find missing fields and therefore b) users time and c) increase 
the likely hood of not users getting frustrated and not completing the form.

Original issue reported on code.google.com by eli...@gmail.com on 14 Jun 2010 at 9:02

GoogleCodeExporter commented 8 years ago
Thanks for the feedback,

The request to displaying multiple error messages during js validation 
initially came up in issue 31 - 
http://code.google.com/p/php-form-builder-class/issues/detail?id=31&can=1.  I 
agree with your last statement.  This is a topic that we will address in an 
upcoming release.  In the meantime, patches are always welcome.

It's worth noting that the jsErrorFunction form attribute can currently be used 
to override the default javascript function responsible for error reporting 
(scroll up and show box) within the project.  This attribute should be set to a 
string representing a javascript function.  Your custom function will 
automatically be passed the appropriate error message as its one and only 
parameter.  This attribute should be defined without parenthesis as seen 
below...

$form->setAttributes(array(
    "jsErrorFunction" => "myCustomErrorFunction"
));

This would allow you to implement the simpler modal/light box error message 
that you described above.

Original comment by ajporterfield@gmail.com on 15 Jun 2010 at 2:51

GoogleCodeExporter commented 8 years ago
r332-r340 contains updates that add this functionality into the project.  It 
will be released in version 1.1.0.  In the meantime, you can download the 
lastest working copy with the command found below...

svn export http://php-form-builder-class.googlecode.com/svn/trunk/ 
php-form-builder-class

Original comment by ajporterfield@gmail.com on 29 Aug 2010 at 9:14