Hi,
I have this page that contains a dataset and a form for the user to fill.
The onReady function extracts the email of the loggedIn user and put it in the email inputBox.
Then the user fills in the other inputBoxes and Submit.
This is all works fine except if the user wants to submit another form with different data then the email field isn’t populated since we never changed page to rerun the onReady function.
Is there a way to rerun the onReady function without leaving the page?
Thank you for any help!
Pierre Lacasse
Hi Pierre,
in your on ready function do not write the full code, just call another function that will do that.
then call the same function to rerun the same code based on another event
for example instead of:
$w.onReady(function () {
$w('#switch').onClick(event => {
if ($w('#switch').label === 'On') {
$w('#switch').label = 'Off';
} else {
$w('#switch').label = 'On';
}
});
});
do the following:
$w.onReady(function () {
flipTheSwitch();
});
export function container2_onClick(event) {
flipTheSwitch();
}
export function flipTheSwitch() {
$w('#switch').onClick(event => {
if ($w('#switch').label === 'On') {
$w('#switch').label = 'Off';
} else {
$w('#switch').label = 'On';
}
});
}
Shlomi