Custom Fields
Re-Envisioned
Support MB Frontend Submission Duplicate form submissions

This topic contains 7 replies, has 2 voices, and was last updated by  Anh Tran 2 months ago.

  • Creator
    Topic
  • #14052
    Resolved
    Ryan Lauritsen
    Participant

    We have a frontend submission form that is getting duplicate (and in some cases multiple duplicates) submissions because users are clicking submit multiple times while the form is processing/submitting. Any ideas on how we can prevent this?

    Maybe a way to disable the submit button after the first click (while still allowing for correcting any failed validation)?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #14060

    Anh Tran
    Keymaster

    Hi Ryan,

    This might be a generic problem for all forms. I think your suggestion is good. It can be done with some custom JS.

    #14071

    Ryan Lauritsen
    Participant

    Thanks, Anh. How can I utilize the submitHandler for jQuery Validate with metabox?
    https://jqueryvalidation.org/validate/#submithandler

    #14077

    Ryan Lauritsen
    Participant

    Nevermind. I’ve figured out a solution.

    #14079

    Ryan Lauritsen
    Participant

    I’m still struggling with this. Anything I do with the validate() method in my own javascript file (enqueued via rwmb_enqueue_scripts hook) is causing the metabox validation function to not work. No jquery form validation occurs. Any suggestions?

    #14092

    Anh Tran
    Keymaster

    Hi Ryan, I think the validate method works only once, e.g. if you implement a validation on the form, then Meta Box’s validation won’t work.

    A simple workaround is copying the code from validate.js to your file.

    Probably I’ll make this feature in the next version. Letting you or other developers doing this seems a little bit confusing.

    #14107

    Ryan Lauritsen
    Participant

    Thanks, Anh. I still can’t get this to work. When I replace metabox’s valide.js with my own javascript file, validation doesn’t work at all. The form can be submitted without any validation.

    Can you send a fix to me before you push it out with the new version of metabox so that I can get it implemented right away? We really need a fix ASAP.

    Thank you.

    #14138

    Anh Tran
    Keymaster

    Hi Ryan, I’ve just fixed this bug and sent you a copy via email. Please try it and let me know the result.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.