We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29703
    • 217 Posts
    I had a shot at answering the question above but failed. I would presume that you defined the html in the template variable (maybe by binding a chunk? I do not know).

    I have a quick, really simple question that has me stumped. After I create a new page it gives me the message "Thank You! Your information was successfully submitted.". I can’t find the code for this anywhere, does anyone have any idea where it is? I just need to change that message.

    Thanks.
      • 30100
      • 58 Posts
      FDM uses eform so the "thank you" message should be the one in eform’s language file /assets/snippets/eform/lang/english.inc.php or the corresponding for your language line 9.

      Missed this one at first FDM parameter &eform_thankyou
      chunk name (non-numeric) or document id (numeric) to use as a thank you message displayed to the user after a successful submit. Tags: same as for &tpl .
      So this parameter with a chunk name should do it.
        • 4172
        • 5,888 Posts
        @2wistd
        you can try it with PHx
        [+tveventdate:ifnotempty=`<p>Event Date: [+tveventdate+]</p>`+]

        Bruno
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 87
          • 51 Posts
          perfect! Now my eform wants all forms filled out! ha, each time I figure something out, something else shows its ugly head. Its the nature of the beast though. Thanks
            • 12983
            • 108 Posts
            If I am in a FDM form page, with the fields to edit (title, content, etc.), does exist a way to know the id associated to the node /record it’s going to create? Please take into account that various users could have an FDM form opened in their browser, ready to be submitted.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Not with any certainty. You could query the database and determine the last auto-generated ID, and presume that this document would be the next, but there’s no way to insure that would be the case.

              It would be possible to create a new, empty document, then use that ID, and use the form’s POST value to update the newly created document.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 12983
                • 108 Posts
                Quote from: sottwell at Aug 29, 2008, 10:57 AM
                It would be possible to create a new, empty document, then use that ID, and use the form’s POST value to update the newly created document.

                This is somehow blurred in my mind, but I will try. Thanks for your suggestion, any help in this direction will be appreciated (e.g. a short tutorial to accomplish that and have certainty)
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I don’t know about a tutorial, but what would have to happen is that the modified FDM snippet would have to create a new document as its first function, and collect the new ID, then generate the form. The new ID could be passed on as a hidden input field’s value in the form so the submission of the form would have it, and the processing of the submitted POST values would use that submission to update the document (using that id) instead of inserting a new document.

                  Probably the best thing to do would be to use the $modx->setPlaceholder() function to store the new ID in the placeholder array as soon as the new document is created, then access it as you wish via the $modx->getPlaceholder() function.

                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 12983
                    • 108 Posts
                    Ok, now it’s a little more clear. Of course the modified FDM will have to delete the created document when the user presses the Cancel button, but if the user just presses the browser’s back button it’s a problem, as an orphan document will remain laying there. This is not very good, so I’ll find other ways to accomplish what I want, avoiding the need to anticipately know the will-be-created document id. Thanks.
                      • 18878
                      • 210 Posts
                      Quote from: michalc at Jun 22, 2008, 11:23 AM

                      I do now have another issue which I didn’t have before. Every new page now always has the menu index of the model document when it is created, but perhaps it is one of my changes that has done this, but I can’t figure out why.

                      Michal.

                      EDIT: I have fixed this using the following code that I placed in fdm.class.inc.php, in the fillDoc function, near the top, in the block that starts with if ($_SESSION[’fdm’][’action’]==’add’ )
                      // Set maxindex to be one greater than other indices
                      $parentID = $_SESSION['fdm']['parent'];
                      $siblingIndices = $modx->getAllChildren($parentID,'menuindex','ASC','menuindex');
                      $maxIndex = $siblingIndices[sizeof($siblingIndices)-1]['menuindex'];
                      $docObj->Set('menuindex',$maxIndex + 1);



                      Hey Michal thanks a lot for that piece of code!!