My first post with this new format, I am surprised the categories were removed, e.g. categories by topic, plugin, etc.
Anyway, I have not done any MODx work for several years and I need to know how after the email value is entered, to check whether it ends with .com or .org, and if not, fail silently, else submit as desired.
I know it would be something like:
<< after click submit button >> (or before, which would be better??)
If email contains com or org, then submit
otherwise do nothing, fail silently and do not show user anything different
</after click submit button>
Thank you, Tom
I’m a little confused about why you would want to do that? If you want to add additional validation to the email field, that’s one thing, but in such a case you’d want to at least show an error message so the user can correct the error.
Assuming you’re using FormIt to handle the form, to not send the email while still pretending it did, you’ll likely need to replace the default email hook with a custom one (snippet) that only sends it if your arbitrary condition is met.
I don’t think you’ll get it done just with output filters, because the email variable wont be available until the snippet has processed, so that’s too late to customise the hooks or something like that.