Can you please elaborate on the use case? How do you submit the form without dataset?
If you are using a simple Insert() function you just set the relevant fields in the inserted object, if you are using dataset you need to use the setFieldValue() function.
To do what you are doing with code and for using that linked forum post, you will need to be using a dataset for this and not a Submission Table from the Wix Forms app.
Hence why they continually have used $w(’ #dataset1 ') in the code on that forum post.
That will mean that you will need to create your own user input form and not use Wix Forms.