Page 1 of 1

Event onsubmit: Call JavaScript suppresses sending the form

Posted: Mon Mar 29, 2021 4:26 pm
by Markus
WB 15.4.5 / x64

Hello everyone,

I built a form that pass data via POST to a PHP file.
Everything works fine, but however I run into a problem. I always have to edit the generated HTML file manually so that the form sends the data.

I call a JavaScript function ( buildData() ) before sending the data. Since I want to manage the entire page including the JavaScript logic within WebBuilder, I have stored the function call as an event on the form.

Image

The problem is that WebBuilder inserts the following addition when generating the HTML page: "; return false;"

Image

This prevents the form data from being submitted.
Can I suppress this behavior somehow?

So far I have to load the generated HTML file in an ASCII editor every time after publishing and manually delete the string added by WB.

Thank you in advance for any hints.
Markus

Re: Event onsubmit: Call JavaScript suppresses sending the form

Posted: Mon Mar 29, 2021 4:45 pm
by BaconFries
This is required for the form submit to work. When you add your own onclick / onsubmit to the submit button it will overwrite the original meaning the form won't submit. To resolve this see the following.
buildData()return true;
http://www.wysiwygwebbuilder.com/forum/ ... 10&t=37833

Re: Event onsubmit: Call JavaScript suppresses sending the form

Posted: Mon Mar 29, 2021 5:22 pm
by Markus
Great, BaconFries, thank you for the fast and helpful hint. :)