Greetings, I have user input on my Wix site that then redirects to the main page where the user input displays. When it redirects to the main page the new user input doesn’t display unless I manually refresh the page. Is there a way to have the page automatically refresh and display the input?
There is a way to refresh, but you shouldn’t do it. Refreshing the page is a bad user experience, and you should avoid it if you can.
Why doesn’t the user input show up? Is it a global element (i.e. element that is displayed on all pages)?
It only shows up with a manual refresh. I would like it to pop up without having to refresh the page. Any suggestions?
@eswheeler1992 Add this code to your page:
$w.onReady(() => {
$w("#userInput1").show();
$w("#userInput1").expand();
//instead of "userInput1" use the property id of your input.
})
Thank you J.D.
@jonatandor35 unfortunately this doesn’t automatically refresh the page and I have to manually do it. Any other suggestions?
It wasn’t supposed to refresh the page, but to show the element.
if you want to refresh it, you can do something like:
import wixLocation from ‘wix-location’;
$w.onReady(() => {
if ($w(‘#input1’).hidden){
wixLocation.to(wixLocation.url);
}
})
//but as I said it’s not a good idea to refresh the page in order to show a hidden element