Actually what happens is the eForm silently fails (that’s what the return false in the snippet’s function does), so the page with the empty form is reloaded; it’s just that (presumably) nobody is there to see it.
And that’s not my idea nor my code, I shamelessly ripped it off from
bobray’s SPForm.
-
- 22 Posts
Tabbing does seem to go to the hidden field(s), but if you then start typing in say Firefox, it tries to do a quick find instead, as if the focus is not on a hidden field.
In the form, give that field some ridiculous tabindex value, and make sure the other fields have sane tabindex values.
-
- 22 Posts
Or just put the hidden field(s) after the form submit/reset buttons but before </form>: works for me.
-
- 24,544 Posts
On reminder about hidden spam fields -- They will occasionally be filled in for regular users when they have password managers like Roboform or LastPass or have browser password filling turned on. The user will fail the spam test and won't know why.
I also question whether they will fool any intelligent bot these days as it's pretty easy to identify a hidden or off-screen form field in code.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
-
- 24,544 Posts
It's a tradeoff. A bot might not fill those in either
-
- 299 Posts
Anyone have success implementing something similar in Revolution for FormIt. We are having a horrible time with some spammers recently on a couple forms and my efforts seem as if they are not working using the :empty in validation.