We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    I haven't actually had a need to accomplish what you're wanting to do, but the need is understandable in a larger organization where you want the ability to route forms. Probably my approach would be to create a form for each person, but then that would be crazy. Too much extra work.

    If you have <select name="addressTo" value="[[!+fi.addressTo]]"> as your select, then it has to be some kind of flaw in FormIt, or it's getting tripped up.

    I am sure you have hammered this out many different ways. Is there an optional CC or BCC anything to try an alternate route.

    If you use ONLY the placeholder [[+addressTo]] does that work? If yes, then it has to be how the coded address and the placeholder are written the FormIt call.

    Maybe no space after the comma (silly, but rule nothing out). I copied an entire server once and zipped it into a folder using SSH because I accidentally put a space where it needn't be.
    `[email protected],[[+addressTo]]`

    I mentioned this: tics around each address — perhaps is thinks everything between the tics is one whole address. when putting the two in there are you getting any email at all from the form?
    `[email protected]`, `[[+addressTo]]`
    Comma not within any tics.

      • 19872
      • 1,078 Posts
      Sorry. I'm probably not much help and I'm sure you've dissected this thing inside and out. Tics around each would not make sense and multiple email addresses are always comma separated. However, maybe that's when you know the address instead of it being a placeholder.

      Question is to: does "addressTo" know that it's supposed to be an email. Perhaps the @ is getting stripped out.. Perhaps there need to be and additional bit that less FormIt know that it's an email address and not just a random field.
        • 46039
        • 76 Posts
        I'm not using an email address and placeholder, the reason I had both in the call I copied was to test that it was actually mailing, once I tested I removed it.

        Also, it's literally all form placeholders not working. It's not specific to the address. None of the placeholders within the snippet call have a value on submit.

        To paste an explicit example:

        &validationErrorMessage=`These should be filled with placeholder values: EMAILTO: [[+emailTo]] ID: [[*id]]`
        


        [[+emailTo]] (changed from addressTo) returns nothing, neither do any of the field placeholders I could add.
        [[*id]] returns the ID of the page fine.

          • 19872
          • 1,078 Posts
          I'll have to come back to this in a bit. Has to have something to do with the structure of everything. The only problems I've had are entry errors, like incorrect placeholder name or one left out of the email chunk.

          What about this name contactus.tpl
          I don't put .tpl anything. Might be OK. Maybe try changing that to contactusTPL or just contactus_email
            • 19872
            • 1,078 Posts
            I just did one test with my own form. Mind you, my placeholders are all successfully being inserted into the email chunk. The test I did was to insert a placeholder into the snippet. I did the emailReplyTo and it worked.

            In your snippet I don't recognize these two items as I don't have them in my forms. Either it's something you are attempting that is beyond what I am doing, or maybe you've mixed in methods for use with Evolution and not Revolution. Just shooting in the dark here.
            &validationErrorMessage=`Please review the form for the following errors: [[+errors]]`
            &submitVar=`contact-form`

            This is not in my snippet call. I don't have this at all. My snippet is below. As well, I have a hidden field that trips up bots that try to complete every field. If the field gets an entry, then the form does not get sent.

            This form time is the hidden field that is the first field in my form (though I don't think it has to be first)
            <input type="hidden" name="workemail" value="" />


            [[!FormIt?
            &hooks=`spam,email,redirect`
            &emailTpl=`ReservationChunk`
            &emailFrom=`[email protected]`
            &emailTo=`[email protected]`
            &emailSubject=`Reservation from [[+firstName]] [[+lastName]]`
            &emailReplyTo=`[[+email]]`
            &redirectTo=`35`
            &validate=`firstName:required,
            lastName:required,
            officeCommon:required,
            officeLegal:required,
            email:email:required,
            phone:required,
            workemail:blank,
            text:stripTags`
            ]]
            
            [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]] 
            


            Have you seen Benjamin's tutorial. http://www.cmstricks.com/blog/2013/03/21/modx-form-submission-with-formit/
              • 46039
              • 76 Posts
              OK this is really really weird... Does your error message placeholder work?

              [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]] 


              This does nothing on any of my MODX installs... I have to write:

              [[!+fi.validation_error_message:notempty=`<p class="error">[[!+fi.validation_error_message]]</p>`]]


              What version of MODX & FormIt are you using? I've now installed MODX on about 10 different machines to try to get FormIt to work. It has not worked on a single one...

              I'm downloading and installing MODX directly off the site each time, adding NOTHING apart from FormIt each time.
                • 3109 ☆ A M B ☆
                • 894 Posts
                Wow 10 machines and still the same issue? That's unacceptable.

                Ok what hosting environment are you using? Windows, Linux, Localhost?

                What version of MODX, PHP and FormIt are you using?

                Post your FormIt code, you Form code and all the tpls you are using so we can try to replicate in our MODX installs.

                Hang in there.
                  Benjamin Marte
                  Interactive Media Developer
                  Follow Me on Twitter | Visit my site | Learn MODX
                  • 46039
                  • 76 Posts
                  I will post my markup etc when I get a spare minute.

                  The machines have been:


                  • LAMP (shared) with php 5.3
                  • localhost on OSX apache mysql php 5.2

                  Sadly thats the only range of hardware / software I have to test on, but I've tested on loads of shared hosting accounts and made sure that they are on entirely different servers, and a few different local macs.
                    • 19872
                    • 1,078 Posts
                    I am actually still a bit confused about how this
                    [[!+fi.validation_error_message:notempty=`<p class="error">[[!+fi.validation_error_message]]</p>`]]

                    is connected to the error displaying in my own form, and have not tried removing it. It may or may not be actually necessary in my case because I have it called on every required form element.

                    I am combining Foundation 5 Form CSS and Error CSS for styling the forms and the error messages. I have a custom error written for each of my required fields. (see below)
                          <label>Last Name
                            <input type="text" name="lastName" id="lastName" value="[[!+fi.lastName]]"/>[[!+fi.error.lastName:notempty=`<span class="error">Please enter last name.</span>`]]
                          </label>


                    I would start from the ground up. Get a simple form to work. The get a single validation and error message to to work. Then build out the rest of the form.

                    Are you working in an all local environment? Or is the site and MODx running on a remote server. When you say installing on 10 machines, what does that mean. You're installing on 10 local machines? Working local in my mind is advanced stuff and from what I can tell, many on the forum spend a lot of time troubleshooting issues with this. I like to work live, one less variable to worry about. That's just me.

                    If there were problems with the install, regardless, you'd be having issues with MODx in general and the manager—I would think not with just one add-on.





                    Quote from: johnnyp at Mar 04, 2014, 04:41 AM
                    OK this is really really weird... Does your error message placeholder work?

                    [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]] 


                    This does nothing on any of my MODX installs... I have to write:

                    [[!+fi.validation_error_message:notempty=`<p class="error">[[!+fi.validation_error_message]]</p>`]]


                    What version of MODX & FormIt are you using? I've now installed MODX on about 10 different machines to try to get FormIt to work. It has not worked on a single one...

                    I'm downloading and installing MODX directly off the site each time, adding NOTHING apart from FormIt each time.
                      • 3109 ☆ A M B ☆
                      • 894 Posts
                      Remove the email hook from your FormIt call and try again, localhost will not send email I think that is your problem.
                        Benjamin Marte
                        Interactive Media Developer
                        Follow Me on Twitter | Visit my site | Learn MODX