How to save the value of elements that is not input elements?

Here, I want to use the submit button to save the data to a collection named Teacher. This will reduce the code and make the program simple. But there is a problem. For input elements, #dropdownCourse, #datePicker1, #checkboxGroupTime, they are linked to the collection. So when the submit button is clicked. Their values will be stored in the collection.
My problem is how to save the text of #textName, #textEmail to the collection. They are not connected to the collection. Hope to get help.
Here are the elements and programming.

Below is the collection. We see that the name and email are not saved in the collection.

Hi there :wave:t2: I think a simpler way than getting the value from the text boxes would be to get the value from the “Members/PrivateMembersData” query you are already performing.
When the submit button is clicked you could get the loginEmail and name values from the Members database and save them to the new database using the save function .
Hopefully this gets you going in the right direction!

After reading your suggestions. To simplify the code, I use dataset save() instead of data save(). The program can now be run. Thank you very much.
The following is the elements and programming.

The following is video to show it is running.

@laizhihong Glad to hear it!

hi there, been searching everywhere for this. finally got the answer. I am copying the code up there and it works fine. Can you tell me the code, if I want to refer to another page if the saving is success ? And if there’s a failure saving process, it will show an error message. It seem, when we use the “save” code it will bypass the function of a Submit button. I am totally blind about this coding. Please help

Hi Henrikus
If “referencing another page” means jumping to a page, please read the following.
wixlocation.to
The following is about the data set save(), you can put anything you want in .then() {…} if submit succeeded, you can put anything you want in .catch() {…} if submit failed.
dataset save()
The following are the elements and code to jump to another page after saving is successful. Hope it is helpful for you.


The following is running code,