Finally, just so that you are aware, you don;t need the two submit button click events as they are doing the same thing.
$w('#submitButton').onClick(function () {
This is how it is added to your code automatically if you add the onClick event handler function to the element through the properties panel.
If you already have it in your code, say like you copied it from another page etc, then when you add the onClick event in the properties panel, it will add a ‘1’ to the end of the name as you already have that name used on your page.
It will also add this new export function line at the end of your current code, so make sure that you delete it if it is not needed.
If you have it already on your page, then simply delete the added ‘1’ from the end of the onClick name in the properties panel and it will be fine with your existing code and it won’t add an additional line.
$w("#submitButton").onClick( (event) => {
This is how you write it when you include the event handler function into your code itself.
With this method you do not need to add the event handler function through the properties panel for it as it is running through the code.