We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26027
    • 145 Posts
    Quote from: Steeve at Oct 29, 2016, 12:42 PM
    You still have a problem with it ?

    I'm sorry to say that I do. It just doesn't make sense to me.

    Are you aware of any debugging tool in ModX or Formit or PHP that might reveal some error taking place under the covers? I wish I could trace the dialogue somehow. I don't give up easily but I'm getting close on this one.

    Sigh!
      • 28432
      • 372 Posts
      There is the error log you can find in Administration > Reports > Errors log.
      You can put your code (your form, the Formit call, and your custom validator) here like this i can test on my own installation.
        • 26027
        • 145 Posts
        That's a very kind offer Steeve. If I took =you up on it do I just cut and paste the Formit call and the processing snippet to my reply.

        How do I get the form itself to you?

        Thanks ... Sam
          • 28432
          • 372 Posts
          Quote from: samg at Oct 30, 2016, 01:05 PM
          That's a very kind offer Steeve. If I took =you up on it do I just cut and paste the Formit call and the processing snippet to my reply.
          Yes copy and paste!

          Quote from: samg at Oct 30, 2016, 01:05 PM
          How do I get the form itself to you?
          When i say form i mean HTML Form with Formit tag like :

              <label for="text">
                  Message:
                  <span class="error">[[!+fi.error.text]]</span>
              </label>
              <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
            • 26027
            • 145 Posts
            Quote from: Steeve at Oct 31, 2016, 02:37 AM
            Quote from: samg at Oct 30, 2016, 01:05 PM
            That's a very kind offer Steeve. If I took =you up on it do I just cut and paste the Formit call and the processing snippet to my reply.
            Yes copy and paste!

            Quote from: samg at Oct 30, 2016, 01:05 PM
            How do I get the form itself to you?
            When i say form i mean HTML Form with Formit tag like :

                <label for="text">
                    Message:
                    <span class="error">[[!+fi.error.text]]</span>
                </label>
                <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>

            Steeve. To me the form and the Formit call are one and the same. I'm feeling a bit stupid and think I'll pass on your offer now. I do very much appreciate your willingness to test it on your system though.

            Best ... Sam
              • 26027
              • 145 Posts
              Quote from: Steeve at Oct 30, 2016, 03:37 AM
              There is the error log you can find in Administration > Reports > Errors log.
              You can put your code (your form, the Formit call, and your custom validator) here like this i can test on my own installation.
              Steeve, guess who's back? I didn't take you up on your offer to test this on your own site because I wasn't comfortable providing some client-specific information in the form itself, like email addresses and field names.

              Instead, I just tried something that tells me my snippet is never being called. The original snippet is called "filterNoreplyAddresses". It's content was:
              <?php
              /* reject email addresses containing noreply, donotreply */
              $email = $value;
              if (strpos($email, 'noreply') !== false || strpos($email, 'donotreply') !== false) {
                    return false; 
              } 
              else {
              return true;
              }
              

              I then changed it to always return false as follows:
              <?php
              /* reject email addresses containing noreply, donotreply */
                    return false; 
              

              When the form still submitted successfully I assumed the snippet wasn't being called.

              Basically I've got a working form and the only modifications/additions I made were:
              Adding &customValidators=`filterNoreplyAddresses`
              and modifying
               &validate=`nospam:blank,name:required,email:email:filterNoreplyAddresses:required`
              

              Unless it's bad syntax to run 3 tests on the 'email' field or perhaps not running the validation snippet last instead of second, I'm stymied as to why it doesn't work.

              If you were going to write a validator to reject an email address like "[email protected]" would you have added any other code than I did? It seems so simple.

              If any thought jumps to mind please advise me Steeve. Some defective human out there is getting his jollies submitting mailing requests with "noreply" as part of the address and he's been accelerating this "game" recently.

              Thanks ... Sam [ed. note: samg last edited this post 9 years, 10 months ago.]