Hello!
I have a problem to setup FormItBuilder. As far as I can see I have followed the instructions exactly as described. The form does appear BUT above it there are 2 big error messages which both say the same:
Notice: Undefined variable: selectedStr in C:\wamp\www\mydomain.com\core\components\formitbuilder\model\formitbuilder\FormElement.class.php on line 895
Call Stack:
# Time Memory Function Location
1 0.0013 691992 {main}( ) ..\index.php:0
2 0.2042 9106640 modX->handleRequest( ) ..\index.php:72
3 0.2093 9435488 modRequest->handleRequest( ) ..\modx.class.php:1291
4 0.2437 9915864 modRequest->prepareResponse( ) ..\modrequest.class.php:128
5 0.2469 10058976 modResponse->outputContent( ) ..\modrequest.class.php:144
6 0.2558 10645968 modParser->processElementTags( ) ..\modresponse.class.php:83
7 0.2643 10991960 modParser->processTag( ) ..\modparser.class.php:221
8 0.2855 11562808 modScript->process( ) ..\modparser.class.php:484
9 0.2912 11699256 elements_modsnippet_11( ) ..\modscript.class.php:66
10 0.3326 13033608 FormItBuilder->output( ) ..\11.include.cache.php:146
11 0.3326 13033608 FormItBuilder->getFormItBuilderOutput( ) ..\FormItBuilder.class.php:1566
12 0.3396 13087008 FormItBuilder_elementCheckbox->outputHTML( ) ..\FormItBuilder.class.php:1349
I first thought its either the jquery validation script or the jquery version so I tried different ways to include it as well as different script versions but no change. I also started from scratch 2 times, always the same prob.
Its probably sth very stupid cuz nobody reported sth like this so far, but I just don't seem to find the problem. Please any help?
Hi Jas,
This is just a notice warning (I have a tiny bug, it doesnt break anything but will output a notice error. Generally you can turn notice errors off in your php.ini for a production environment.... however a bug is still a bug.
Open the
core\components\formitbuilder\model\formitbuilder\FormElement.class.php
go down to line 870ish
and add this little bit to the code ( add the line $selectedStr=''; ). This should stop the notice.
I have just updated this in GitHub. It will be part of the next update. Thanks for the report.
public function outputHTML(){
$a_uncheckedVal = $this->_uncheckedValue;
if($this->_required===true){
$a_uncheckedVal=''; // we do this because FormIt will not validate it as empty if unchecked value has a value.
}
$selectedStr='';
if(isset($_POST[$this->_id])===true){ ... ... ...
GREAT!! THANKS SO MUCH!!! =DD