We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25940
    • 8 Posts
    Here’s what I would like to do with Jot:

    Have the comments show under the article as usual, but instead of the ’enter comments’ form being on that page, I’d like a link that opens a small window that has the input comments form in that. Then when the user finishes with the comments and hits the "Post your comment" button, it closes the pop-up window and refreshes the comments to show his included.

    I have Jot working in its basic, default way. I know how to make the pop-up window. What I don’t know is how to "split" the comments displayed and the comment input with them being linked to the same document. And how Jot can take the document id into a new window and back to the original one, if that makes sense.

    If anyone could even just post examples of how they are doing something like this, that would be great. Thank you.
      • 25979
      • 178 Posts
      have you worked it out? I am also interested in that kind of feature.

      salik
        //Why use windows since there is a door?//
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        I would think that the best way would be with some javascript. Have the <div> container there for the form, but hidden in the CSS. When the user clicks the link or the button, the Javascript makes it visible simply by changing the display: none to display: block. When the form is submitted, the page gets refreshed anyway, so the new comment would be displayed and the form hidden again.
          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
          • 25979
          • 178 Posts
          thx smiley sottwell, today you answer my questions smiley
            //Why use windows since there is a door?//
            • 11214
            • 225 Posts
            Thank you for this very interessant post and simple solution...

            I’have just a problem with the javascript.

            Dear Sottwell, is it possible to have an example of the javascript code to simply change the correspondant div css property ?

            Thanks !





              Verum Index sui et falsi
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Ok, so you have a
              <div id="myForm"> ... </div>

              with the form in this div. Style the div any way you like so that it will show when you want it to. You can give it padding and a background image to simulate a shadow, so it would look like a pop-up.

              You have your button (or link, or <h3> or whatever...it doesn’t matter)
              <input type="button" id="myButton" value="Click Here" onclick="showForm(myForm);"/>

              The javascript could look like this (put it at the bottom of your page)
              <script type="text/javascript">
              function showForm(theForm) {
                showObj = document.getElementById(theForm).style;
                if (showObj.display=='none') {showObj.display = '';}
              }
              </script>
              

              Of course, the form will still be there in the source, just hidden until the user clicks the button, so it would be good for accessibility.
                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
                • 11214
                • 225 Posts
                Thank you very much, Sottwell, for these very "teaching" and precise explanations !

                I will hasten to test... also in particular for the visualization of the comments.

                Thank you still!

                GM
                  Verum Index sui et falsi