We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41125
    • 3 Posts
    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?
      • 41125
      • 3 Posts
      Nobody??? PLEASE!

      BTW this is the Apache Error Log:

      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP Notice: Undefined variable: selectedStr in C:\\wamp\\www\\mydomain.com\\core\\components\\formitbuilder\\model\\formitbuilder\\FormElement.class.php on line 895
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP Stack trace:
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 1. {main}() C:\\wamp\\www\\mydomain.com\\index.php:0
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 2. modX->handleRequest() C:\\wamp\\www\\mydomain.com\\index.php:72
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 3. modRequest->handleRequest() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modx.class.php:1291
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 4. modRequest->prepareResponse() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modrequest.class.php:128
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 5. modResponse->outputContent() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modrequest.class.php:144
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 6. modParser->processElementTags() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modresponse.class.php:83
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 7. modParser->processTag() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modparser.class.php:221
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 8. modScript->process() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modparser.class.php:484
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 9. elements_modsnippet_11() C:\\wamp\\www\\mydomain.com\\core\\model\\modx\\modscript.class.php:66
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 10. FormItBuilder->output() C:\\wamp\\www\\mydomain.com\\core\\cache\\includes\\elements\\modsnippet\\11.include.cache.php:146
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 11. FormItBuilder->getFormItBuilderOutput() C:\\wamp\\www\\mydomain.com\\core\\components\\formitbuilder\\model\\formitbuilder\\FormItBuilder.class.php:1566
      [Wed Sep 05 20:07:13 2012] [error] [client 127.0.0.1] PHP 12. FormItBuilder_elementCheckbox->outputHTML() C:\\wamp\\www\\mydomain.com\\core\\components\\formitbuilder\\model\\formitbuilder\\FormItBuilder.class.php:1349
        • 18270
        • 68 Posts
        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){ ... ... ...

          • 41125
          • 3 Posts
          GREAT!! THANKS SO MUCH!!! =DD
            • 25429
            • 32 Posts
            Hi marcushouse,

            Great job with formItBuilder!

            I've run into an issue with matrix elements. My form otherwise works (XAMPP 1.8.1) just fine, but when I insert the exact lines you specified

            $o_fe_textMatrix = new FormItBuilder_elementMatrix('textMatrix','List your favorite websites', 'text',
                array('Website #1','Website #2','Website #3','Website #4', 'Website #5'),
                array('Site Name','URL','Speed','Design')
            );


            and

            add it as

            $o_fe_textMatrix


            It gives me this error message

            Notice: Undefined variable: s_ret in D:\xampp181\htdocs\pmdk\core\components\formitbuilder\model\formitbuilder\FormElement.class.php on line 603

            Any ideas?