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.
@2wistd
you can try it with PHx
[+tveventdate:ifnotempty=`<p>Event Date: [+tveventdate+]</p>`+]
Bruno
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
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.
-
☆ 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.
-
☆ 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.
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.