Hello Team Backendless,
I have a form with some input fields and selectors, and a “Submit” button. But when clicking “Submit”, nothing is submitted and the console shows a bizarre warning (not error, warning):
“Form submission canceled because the form is not connected” — I cannot figure out what is wrong or what this message could possibly mean. Can you help?
I cannot reproduce.
Can you provide detail steps to reproduce?
Best Regards, Nikita.
Hi Nikita, I don’t know how to reproduce from scratch either… but here is our app id: AE4235E1-DBB7-C6F0-FF4A-E0378B0B2B00, the page is “ClassCreate”. It’s a multi-step form where 3 forms are inside a block that serves as a Data Model. The 1st form submits fine when you fil in some info and click “Next”. But when clicking “Next” (submit) in the second form, it produces the error in console…
In your second form, you have logic on the “next button” for “submit” handler and “onClick”.
“onClick” handler will call faster than “submit”.
The prblem is that “onClick” logic removes the form from the HTML document, which is why there is an error on “submit” logic. “Submit” handler requires the form to be in the HTML document.
Hi Viktor — ah yes, I see! So basically we should never add any logic to “on click event” for a submit button… rather, we always use the “on submit event” for the form. Maybe it would be best to disable “on click” event handler if a button is set to type “submit” on a form? Or is there any reason why someone would still want to access “on click” event handling if the button is of type “submit”?
Thanks for your help