Event onsubmit: Call JavaScript suppresses sending the form

Issues related to forms.
Post Reply
User avatar
Markus
 
 
Posts: 113
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Event onsubmit: Call JavaScript suppresses sending the form

Post 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
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: Event onsubmit: Call JavaScript suppresses sending the form

Post 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
User avatar
Markus
 
 
Posts: 113
Joined: Fri Nov 23, 2018 1:06 pm
Location: Germanskow

Re: Event onsubmit: Call JavaScript suppresses sending the form

Post by Markus »

Great, BaconFries, thank you for the fast and helpful hint. :)
Post Reply