We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7469
    • 0 Posts
    Hi, I’ve made a formit call:

    [[!FormIt? &hooks=`snippet_parseresult` &store=`1` &validate=`IMDbMovieCode:required]]

    in the form there’s a field ’Code’, which I want to use in a custom snippet (snippet_parseresult), but I can’t seem to access the field result. I dug into some of the FormItcode, and now I use:

    require_once(’core/components/formit/model/formit/fihooks.class.php’);
    $hook = new fiHooks();
    $Code = $hook->getValue(’Code’);

    This doesn’t result in any error messages, but I’m guessing this is totally the wrong way. Can somebody please help? Tnx!
      • 3749
      • 24,544 Posts
      Have you tried that without the first two lines? The $hook object should be available already.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 7469
        • 0 Posts
        I did, but then I got an error message. But now I tried again, after your suggestion, and now it works! Tnx!

        I think earlier I made the wrong FormIt-call, e.g. when I include a redirect (and also &redirecTo), then, this doesn’t work. Also, earlier I didn’t put the result in a placeholder, rather I tried to ’return’ the result directly to the resource (return $Code;), which is not the proper way to do it and probably caused the error. Hope this helps someone else.

        Tnx again!