We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19328
    • 433 Posts
    Every now and then we get an email notification of a submitted form that is not correct: some of the placeholders are not working, we see things like
    [[+comment]]
    in the email.

    The submitted data also gets placed in the DB on form submission. This works (an entry is created), but the fields that don't work in the mail are also empty in the DB. The strange thing is that one other field does get submitted properly. And it only happens like once on every 100 submissions.

    This is different from the user just not filling in some fields. If I submit the form with a few fields not filled in, they are empty but the placeholder does not show up. And a few fields that go wrong are required, so it shouldn't even be possible to submit without filling them in.

    We've been trying all sorts of things but don't really know where to look. We've tested in older browsers and with cookies disabled but cannot reproduce this error. I hope someone with more insight in how formit works might point us in the right direction: what could prevent the placeholders from being set in the email and the data being submitted? Could someone bypass the normal way the form works and submit through a script or something? I ask this because one day we received like 30 of these submissions in under a minute. Or would it be a browser setting?

    We're using modx Revo 2.2.4, Formit 2.1.1. The form also uses formitRetriever: it's a multipage form and the user can go back and forth in the form.

    Thanks for any help!
    • FormIt only sets placeholders for fields it gets POSTed, so if it shows up in the email, it must not have been posted.. I'm guessing that if you get a large number of them randomly, someone might be toying around with dev tools to remove the field and posting that. Is the comment field required per &validate? If not, setting it may prevent it from submitting entirely if the user is toying around.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 19328
        • 433 Posts
        Thanks Mark for your reply and for your suggestion of making the field required with &validate. I'll put that in there and hopefully it won't happen anymore.