We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29327
    • 4 Posts
    Hello, all!

    Pls, could you explain me how can I use in eFrom the value which comes in $_GET array? I need something like this <input type=hidden name=task_id value=<?=$_GET[’task_id’];?> />. As far as I understand it is impossible to use php-code in chunks, so I wonder how to deal with this and couldn’t find the solution mysef. Pls, help me, Natalia
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Make a snippet, with exactly the same code you would use in the <?php ... ?> block, only make sure to "return $value" the GET value. Then put the snippet tags where you would normally put the <?php ... ?> tags. The snippet will return the GET value for you.
      return $_GET['task_id'];
      

      would do the job; a bit of error handling might be a good idea though, like what to do if there is no such GET value.
        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
        • 29327
        • 4 Posts
        Thank you very much. It works!
        But I come across with one more problem: if I upload file in my eform where would it be stored or it would be just sent by email?
          • 30223
          • 1,010 Posts
          By default uploads are send as an attachment to the email, and then discarded.
            • 29327
            • 4 Posts
            Thanks a lot!
              • 33273
              • 60 Posts
              It doesn’t work for me.....
              Tampering access detected........
                • 15360
                • 20 Posts
                I have some related issue.

                I’ve succesfully created a form which fills a couple of fields through the use of $_GET variables, like mentioned above.

                But the problem is that these fields lose there values after validation error. Is there a way to retain these values when using $_GET variables?
                  • 15360
                  • 20 Posts
                  Problem fixed! Made a mistake with ’readonly’ tag, which created the unexpected behaviour.. smiley