We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33144
    • 5 Posts
    Hope someone can shed some light on this...

    Just started using MODx but I have come across weird behaviour with posting info with forms e.g. ContactForm and FlexSearchForm

    I am using friendly URLs, with .htaccess sorted out, problem is that the forms seem to retain the previous post rather than what was currently posted.... bit weird to explain!

    Its like whatever variables I am using are not being posted so the form deals with whatever it had last. I have managed to get something posted (sometimes) but once that happens it gets stuck and will keep on using the previous info irrespective of what i enter into available fields. This appears to be the same for both ContactForm and FlexSearchForm

    It seems weird because if this were to do with MODx then Im pretty sure someone would have noticed - so this points it towards what I am doing or how I installed MODx... neither of which are radical!

    Basically involving a form seems to misbehave.... any ideas?



    Cheers,


    Rik
      • 7923
      • 4,213 Posts
      Is the document uncached or do you use uncached sippet calls? e.g. [!snippet!]


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 33144
        • 5 Posts
        Call to snippet is [[ContactForm? &sendTo=`[email protected]`]]

        (obviously ’sendTo’ is fake)

        I assume this uncached...?

        Do you want a URL to see what is going on?

        Rik

          • 7923
          • 4,213 Posts
          Try [!ContactForm? &sendTo=`[email protected]`!]


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 33144
            • 5 Posts
            You star!

            Worked a treat.... whats the difference with the tags? I guessing [[.*?]] is cached, whilst [!.*?!] is not?

            That will fix a few things I was playing with...... beginning to really like MODx...!

            Cheers doze.....


            Rik
              • 33144
              • 5 Posts
              Replied too soon...

              works perfect with [!ContactForm!] but FlexSearchForm takes the first search but then keeps the value from the first search for subsequent searches.....

              call is...

              [!FlexSearchForm? &FSF_showResults=`0` &FSF_landing=`7`!]

              Feel like we are on the right track (me not knowing what I am doing!)..... feels like the same problem but I could be wrong!!

              Thanks in advance...


              Rik
                • 7923
                • 4,213 Posts
                Quote from: ykir84 at Jul 06, 2006, 03:12 PM

                works perfect with [!ContactForm!] but FlexSearchForm takes the first search but then keeps the value from the first search for subsequent searches.....

                call is...

                [!FlexSearchForm? &FSF_showResults=`0` &FSF_landing=`7`!]
                Is the snippet call on the "landing" document uncached too? or the document uncached?

                And yes, by calling snippets with [[snippet]] makes them cached, so they run the first time and after that results are coming from modx cache. By using [!snippet!] you can force the snippet to run uncached every time. Buy you know you can also set the whole document to be cached/uncached when creating one, right..? Its on the Page Settings tab, Cacheable checkbox. If document is uncached and you use "cached" [[snippet]] call, it won’t be cached, because the whole document is uncached. Use what ever suits the best for you.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 33144
                  • 5 Posts
                  Perfect!

                  Get it now... I modified the landing page to be uncached and modified the call in the landing page to use the uncached call e.g. [!...!]... works perfectly....

                  Hope this helps another newbie out..... makes sense when someone explains (as always!)

                  Thanks doze,


                  Rik

                  Re-reading the reply from doze made me realize that changing either the call or the pages ’cacheable’ status achieves the same thing... doing both is just anal!!! Thanks again for a great explaination.....
                    • 7923
                    • 4,213 Posts
                    Glad to help. And btw, if you set the page uncached, you don’t need to use [!...!] call, [[...]] works perfectly well also because the document is allready uncached..

                    Actually, a while ago there was a bug where some snippets (that use specific modx api calls) didn’t work, if called on a uncached page with an uncached snippet call. I think this bug is still valid in the current modx version (but is being adressed to).


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."