Getting "TypeError: $w(...).onAfterSave is not a function "

I implemented this tutorial :
https://support.wix.com/en/article/how-to-send-an-email-on-form-submission
and I’m getting the following error:
TypeError: $w(…).onAfterSave is not a function

Hi Vincenz,

Welcome to the Wix Code forums.

From the tutorial:
$w(“#sportDataset”).onAfterSave(sendFormData);

As shown in the above code from the tutorial, you need a dataset (#sportDataset in the tutorial), and it needs to be connected to a database collection. If you don’t have a dataset on your page, then you will get the error message.

I hope this helps,

Yisrael

I have a dataset mines still not working what do I put in that spot