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

    Just started using FormIt, but unfortunately, for whatever reason, FormIt works quite nicely with the sample contact form (successful email and all) from the documentation, but doesn't work for my form, and I can't figure out why.

    For simplicity's sake, I haven't been using the email chunk, as I try to test what exactly is wrong.
    My form:
    [[!FormIt?
       &hooks=`spam,redirect`
       &emailTo=`********e.io`
       &redirectTo=`10`
       &validate=`nospam:blank,
          urgent:required,
          episode:required`
    ]]
    [[!+fi.validation_error_message:notempty=`<div style="line-height: 1;" class="uk-alert-danger" uk-alert>
        <a class="uk-alert-close" uk-close></a>
        <p>[[!+fi.validation_error_message]] Did you select one of the options for the checkbox?</p>
    </div>`]]
    
    <form action="[[~[[*id]]]]" method="post" class="form">
        <input type="text" name="name" id="revid" value="[[!GetReviewerID]][[!+fi.revid]]" hidden />
        <input type="text" name="episode" id="episode" value="1" hidden />
        <input type="text" name="nospam" id="nospam" value="" hidden />
        <div class="uk-margin-bottom">
            <label class="uk-form-label">Are there any errors/changes that should be made in this episode?<br></label>
            <input class="uk-radio" type="radio" name="urgent" value="Good"> Looks good!</input>
            <input class="uk-radio" type="radio" name="urgent" value="Small changes"> Small changes, but nothing worth delaying publishing over.</input>
            <input class="uk-radio" type="radio" name="urgent" value="Urgent changes"> <b>URGENT</b> corrections needed before publishing!</input>
        </div>
        <div class="uk-margin-bottom">
            <label class="uk-form-label">Corrections, comments and thoughts here.</label>
            <textarea class="uk-textarea" rows="7" name="text" 
            placeholder="Type as much or as little as you'd like! Please be specific with any recommendations.">[[!+fi.comments]]</textarea>
        </div>
        <input type="submit" class="uk-button uk-button-primary" />
    </form>


    Just to clarify, it looks like the form is being submitted successfully (the redirect to my resource ID=10 works), but I don't receive an email.

    This question has been answered by treigh. See the first response.

    [ed. note: muffinjello last edited this post 7 years, 1 month ago.]
    • discuss.answer
      • 30585
      • 833 Posts
      What happens when you add the email hook?
      &hooks=`spam,email,redirect`
      
        A MODx Fanatic
        • 43432
        • 19 Posts
        Quote from: treigh at Feb 12, 2017, 10:14 PM
        What happens when you add the email hook?
        &hooks=`spam,email,redirect`
        

        Oh my god ahaha, I thought that the "email" hook was for doing proper email validation on the form fields (which my form does not have).

        That did the trick! Thank you so much!
          • 30585
          • 833 Posts
          Glad it worked!
            A MODx Fanatic