Error: Operation (save) not allowed during save

Hello,
When clicking on the rating module I get the following error message in the preview:

UserError: datasetApi ‘save’ operation failed
Caused by DatasetError: Operation (save) not allowed during save
Caused by: DatasetError: Operation (save) not allowed during save
Error: Operation (save) not allowed during save

The error message appears every time. However, the collection is updated every time (Entry for last updated), but the value of the input is entered and saved inconsistently.
The permission setting of the collection give full access to logged in members. I have not activated a sandbox. The dataset “myRatingDataset” is set to read & write. The Input element is not connected/linked via editor.

Can anyone help me out here? Would be greatly appreciated. Am really confused with this problem.

My code:

export function inputSoftware_click ( event ) {
if ( ratingExists <= 0 ) {
$w ( “#myRatingDataset” ). add ()
. then (() => {
$w ( ‘#myRatingDataset’ ). setFieldValues ({ productId : product , software : $w ( ‘#inputSoftware’ ). value });
ratingExists = 1 ; filterMyRating ();
})
. catch (( err ) => { let errMsg = err ; console . log ( "Error is : " + errMsg );});
} else {
$w ( ‘#myRatingDataset’ ). setFieldValues ({ productId : product , software : $w ( ‘#inputSoftware’ ). value });
}
$w ( ‘#myRatingDataset’ ). save ();
}

Hi, I am a real novice, but I used to get this error when I had the command to save the dataset in my code and also the button was set to “Submit” to the dataset. Not sure if that helps.

Thank you for your input! In my case the buttons do not submit anything and the saving of the values is only controlled by the code. The alleged double saving is not logical for me.

Solved it. The WIX support helped me. I had to change the onClick event to an onChange event.