We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21262
    • 1 Posts
    I keep getting this error and I’m not sure why Exactly.

    [2011-05-12 22:23:35] (ERROR @ /index.php) [FormIt] Could not find hook "redirect`
       ".


    [[!FormIt?
       &hooks=`recaptcha,spam,email,redirect`
       &emailTpl=`ccl-contact`
       &emailTo=`[email protected]`
       &redirectTo=`2`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags`
    ]]
    [[!+fi.error_message:notempty=`
    <p>[[!+fi.error_message]]</p>
    `]]
     
    <form class="form" action="[[~[[*id]]]]" method="post">
    <fieldset class="s_column">
        <input name="nospam:blank" type="hidden" />
    <div>
        <label for="name">
            Name:
            <span class="error">[[!+fi.error.name]]</span>
        </label>
        <input id="name" name="name" type="text" value="[[!+fi.name]]" />
     </div>
    <div>
        <label for="email">
            Email:
            <span class="error">[[!+fi.error.email]]</span>
        </label>
        <input id="email" name="email" type="text" value="[[!+fi.email]]" />
     </div>
    <div>
        <label for="subject">
            Subject:
            <span class="error">[[!+fi.error.subject]]</span>
        </label>
        <input id="subject" name="subject" type="text" value="[[!+fi.subject]]" />
    </div>
    <div> 
        <label for="text">
            Message:
            <span class="error">[[!+fi.error.text]]</span>
        </label>
        <textarea id="text" cols="50" rows="7" name="text">[[!+fi.text]]</textarea>
    <br class="clear" />
    </div>
    [[!+formit.recaptcha_html]]
        [[!+fi.error.recaptcha]]
    <br class="clear" />
    <div class="form-buttons">
            <input type="submit" value="Send Contact Inquiry" />
        </div>
    </fieldset>
    </form>


    Sorry about all the divs were for formatting purposes. I’ve tried changing the ` to ’ but that doesn’t help. And, it doesn’t send the email but I’m guess that’s because it doesn’t finish processing once it finds a hook is missing. And, it’s not just the redirect it’s whatever the last hook is.
      • 3749
      • 24,544 Posts
      First, turn off the rich text editor and change &amp; to &.

      They need to be backticks.

        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
        • 21262
        • 1 Posts
        Ok, I made the form a chunk so TinyMCE wouldn’t mess with it. However it still seems to be giving the same error. When site like this.
        [[!FormIt?
           &hooks=`recaptcha,spam,email,redirect`
           &emailTpl=`ccl-contact`
           &emailTo=`[email protected]`
           &redirectTo=`2`
           &validate=`name:required,
              email:email:required,
              subject:required,
              text:required:stripTags`
        ]]


        It seems to now be sending emails from the address entered but name, subject, or text aren’t being inserted into it. And, doesn’t redirect still as well.
          • 3749
          • 24,544 Posts
          That suggests an error in your cc-contact chunk. Try taking the hyphen out of the name and make sure the spelling of the chunk name is correct.

          Check the format of the placeholders in the chunk. They should look like the ones here: http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page
            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