Why onSubmitWixForm function is not called on form submission?

The $w(‘#wixForms1’).onWixFormSubmit function is not called on form submission, but the onClick handler on submit button is called, why?
I thought that the button is not actually a submit button, there is maybe a property to set?

You should add some pics of your setup to your description. A pic can show and describe more then 1000 words.


If I click the execute button, fill the form fields and then click the submit button (“Iscriviti”), it only prints “click” and not “submit”

Ok.

First we learn how to describe your issue the best way.

EXAMPLE:

  1. My setup: - Working on ordinary Wix-Editor.
  2. Using WixForms in my setup.
  3. Using/not using DATASETS, if so and if relevant → mention it!
  4. Setup and issue description.
  5. Some pics for better overview of your issue/problem.

So, since we know know all your setup and problem-description, now we can start to analyse your problem.

Let’s say you have chosen the following WixForm (can be found as predefined form in the wix-forms-choices)…

First thing what is strange —> you can’t find the option → onWixFormSubmit() anywhere…all you have is…

But anyway it is existing, when we check the Wix-Form-API.

So, making some little test to prove it’s existence and functionality…

$w.onReady(()=>{
	
	$w("#wixForms1").onWixFormSubmit((event) => {console.log('onSubmit')
		console.log(event)
	});

});

And what do we get ?

2023-11-26 22_33_57-Wix Website-Editor _ My Site 13

As you can see, it indeed works!

Hi, sorry for the late response and sorry but I didn’t know how the website was created, I was just trying to add some code and thought the process to create a form was straightforwad.

But anyway, I did this test

$w.onReady(() => {
	console.log('ready')

	$w("#wixForms1").onWixFormSubmit((event) => {
		console.log('onSubmit')
		console.log(event)
	});
});

But it logs just “ready”

The popup window says that if I want to see the checkout preview of the form I should go on published website