We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22095
    • 30 Posts
    Ah, yea... tinyMCE loads fine, but is rather buggy in khtml. I’ll add that back as the last part when I’m finished with my form.

    Another question/request (which might be eform related rather than FDM). Say I’ve got a TV which is a DropDown List Menu, is there any way to automaticly handle it? (it’s updated dynamicly when new documents are added in a specific folder)

    Edit:
    Another question, can I have a blank model, so no values gets pulled to my new form?
      • 29039
      • 58 Posts
      Ups...

      PHP error debug
      Error: file_get_contents( [+user.canadd:is=`1`:and:if=`[+link.disableadd+]`:is=`0`:then=` New Document `:strip+] [+link.disableedit:is=`0`:then=` [+user.ismoderator:is=`1`:or:if=`[+user.isauthor+]`:is=`1`:then=` Edit `:strip+] `+] [+user.ismoderator:is=`1`:then=` [+doc.published:is=`0`:and:if=`[+link.disablepublish+]`:is=`0`:then=` Publish `:strip+] [+doc.published:is=`1`:and:if=`[+link.disableunpublish+]`:is=`0`:then=` Unpublish `:strip+] [+link.disabledelete:is=`0`:then=` Delete `:strip+] `+]
      ) [function.file-get-contents]: failed to open stream: No error
      Error type/ Nr.: Warning - 2
      File: C:\Xampp\htdocs\1nets\assets\snippets\FDM\includes\chunkie.class.inc.php
      Line: 49
      Line 49 source: $template = file_get_contents($tpl);

      What is wrong?
        • 27889
        • 415 Posts
        I know what it is, see this post: http://modxcms.com/forums/index.php/topic,15255.msg100417.html#msg100417 , It will be corrected in next version.
          MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
          MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
          • 22095
          • 30 Posts
          one more question:
          From the supplied fdmEform:
           <p><label for="createdby">Created by:</label><br />
           [[SelectUser]]
              <input type="text" name="createdby" id="createdby" maxlength="60" size="15" value="[+createdby+]" />    
          </p>

          What is SelectUser?
            • 27889
            • 415 Posts
            It’s a snippet which generate a dropdown list for selecting an user here for createdby, is it just here as a tips. you can remove it, the parameters are explained in the snippet code.
              MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
              MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
              • 22095
              • 30 Posts
              Aha, it’s called select, not SelectUser... wink

              It works mighty fine, I extended it a tiny bit to allow a WHERE select.

              <?php
              // value for the posted fields
              $value=isset($value)?$value:'id';
              // field displayed in the select input
              $display_field=isset($display_field)?$display_field:'username';
              // name of the table frow which the value are get
              $tblname=isset($tblname)?$tblname:'web_users';
              // name of the form field
              $namefield=isset($namefield)?$namefield:'createdby';
              //where field
              $wherefield=isset($wherefield)?$wherefield.' = ':'';
              //where key
              $wherekey=isset($wherekey)?$wherefield.$wherekey:'';
              // label of the form field
              $labelfield=isset($labelfield)?$labelfield:'Created by:';
              // an empty value should be displayed ? true or false
              $emptyval=isset($emptyval)?'<option value=""></option>':'';
              
              // end of parameters
              
              $negate=($tblname=='web_users' && $value=='id')?'-':''; // negative the value for web user
              $result = $modx->db->select("$value, $display_field", $modx->getFullTableName($tblname), "$wherekey");
              echo "<p><label for=\"$namefield\">$labelfield</label><select name=\"$namefield\" id=\"$namefield\">\n";
              echo $emptyval;
              		while ($row = mysql_fetch_assoc($result)) echo '  <option value="'.$negate.$row[$value].'">'.$row[$display_field].'</option>'."\n";
              echo '</select></p>';
              ?>


              There might be room for improvements in the sensible variable names department... wink

              Haven’t checked if it’s proberly validated by eForm (but in this particular case, it doesn’t really matter).
                • 27889
                • 415 Posts
                According to Tobyl it seems that validation don’t work with embeded snippet, I think I will remove it in the next version. Feel free to use.
                Edit New version uploaded, select is removed and chunkieclass modified
                  MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                  MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                  • 29039
                  • 58 Posts
                  Quote from: Soda at Jun 10, 2007, 09:37 AM

                  I know what it is, see this post: http://modxcms.com/forums/index.php/topic,15255.msg100417.html#msg100417 , It will be corrected in next version.
                  Thanks for reply.
                  I replace the function code with that one. And i have nothing. No eror and no results. What can i do more to try you snipet. Can you post a correct code?
                  Please.
                  Sorry for bad english.
                    • 27889
                    • 415 Posts
                    There is an error in 0.0.78 if you call FDM with default template for Button Bar, try the new posted version.
                      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                      • 22549
                      • 19 Posts
                      Error in 0.0.8, when I click on add icon, this error appears

                      « MODx Parse Error »
                      MODx encountered the following error while attempting to parse the requested resource:
                      « `` is not numeric and may not be passed to makeUrl() »
                      
                      Parser timing
                      MySQL: 0.0399 s (16 Requests)
                      PHP: 0.1137 s
                      Total: 0.1535 s
                      


                      When I look at manager, new page is created, as is a replica of param model, so I think it’s adding good, but editing is not working..... BUT!!! I open a page for editing andis working good... tongue