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

    I want to pass custom values to the form I am building.
    On form submit, I want the form to give the user access to a particular file (in my case, a static resource pdf).

    So I assume I should pass a variable to the static resource through a url like so:
    <a href="[[~112]]?dl=110">Download tech specs</a>
    

    In the above, 112 is the resrouce id of the form and 110 is the resource id of the final download (the static resource).
    I want to do a $_GET and get the value from the url.
    How do I do this in a custom hook snippet with formit?
      • 28215
      • 4,149 Posts
      You could add it as a hidden input field, and fill the value with a preHook.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 1381
        • 7 Posts
        Hey Shawn,

        Thanks for the reply. I will try that out.
        Congratulation btw on the new Modx release.
        Just wanted to say that the work you’re doing to truly awesome. I really wish though you would post more tutorials on working with the Modx API. The documentation needs more examples and the community needs more tutorials. I have very basic PHP skills and this stuff is really hard for me.
        Could you please make it easier for us to learn and get more out of Modx?