Bugs in frontend-submission.js

Support MB Frontend Submission Bugs in frontend-submission.jsResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #33589
    Stephen C.Stephen C.
    Participant

    Up until now, I had all my forms redirect after submission. However, now I have a form in a modal where the user is kept on the page after the form is submitted via AJAX (no redirect). The normal behavior is supposed to be that the confirmation message replaces the form if it's a new submission. However, this is not happening. The confirmation message is displaying above the form, as if it is an edit and not a new submission.

    I unminified frontend-submission.js and found that

    (t =<div class="rwmb-confirmation${n ? "" : " rwmb-error"}">${t}</div>), c ? e.prepend(t) : e.replaceWith(t);

    doesn't work because on a new submission the value of c is the string "false" and being a string, will always return as true. It would only be false if it were empty or a boolean type.

    Also:

    t = e.find("button[name=rwmb_submit]"),
    n = e.find("button[name=rwmb_delete]"),

    should be:

    t = e.find('button[name="rwmb_submit"]'),
    n = e.find('button[name="rwmb_delete"]'),

    Quotes around the button names are missing. Even though it may work as is right now, it's incorrect not to use quotes.

    #33669
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    I've escalated this issue to the development team to fix it in the next update.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.