Have a button submit data, refresh dataset, and refresh page

  • I need a button to be able to submit the data, refresh the dataset and refresh the page whenever it is clicked.

  • I have tried using the following forum post , and the code within the post (I also matched my own datasets up), to get what I need working but it seems as if there is still an issue with the code, specifcally the error message is highlighted under the => part of the code

onclick - submit data and reload the page - how to? - Ask the community - Community Support Forum | Wix Studio

- Any suggestions?

- Thank you in advance and any help is appreciated!

Hi,

See my reply here

To anyone, who landed here trying to reload a page onSubmit, onClick; try this, worked for me:

import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#button390").onClick( (event) => {
  wixLocation.to(wixLocation.url); // refresh current page
});
});