I'm having a show stopper issue with a form not switching over to another page after a successful dataset submission. Oh yeah, it works just fine in preview mode. The button saves the data, and switches to the other page.
This happens both with a button with a submit action, or with code linked to a click event.
ie:
$w("#dataset1").save()
.then( (item) => {
wixLocation.to("/myreservations");
} )
.catch( (err) => {
let errMsg = err;
changetext("#text64","Missing fields.");
} );
Whatever actions I put in here work, such as changing a text message for example, but the wixLocation does nothing. Strangely, when looking at the live console, it does say that the myreservations.js code gets loaded, but it never leaves the form page.
Am I missing something? This is keeping me from taking the page live.
Hi Pawan,
Some code is required.
My suggestion is to change the text to the relevant language my using text key of $w and not redirect to a different website.
Moreover, I would use onChange event for the switch element so it should look something like this:
export function switch1_change(event) { if (event.target.checked) { $w('#myTextElement').text = 'Text in english'; } else { $w('#myTextElement').text = 'Text in other language'; } }
Good luck!
Roi.
Hi All / @Ofer (Wix) (Wix),
I'm trying to use "User input" 'Switch' to toggle between two websites... a very simple implementation.
There is going to be 2 different language websites (identical).
When user switch it on to 'right' it will redirect to English website and when it is turned off "left" it should go to the language website.
I'm not a coder but have done some basic implementations:
Can someone tell me what exactly I need to do... with code that I can use.
Thanks in advance,
Pawan
Can you share a link to your page?