Progress Bar Not Saving [Repeat Post Check In]

Hello! I have created another post about this matter, however, I haven’t gotten a response in 48-72 hours, so I wanted to create a check-in. I am very disappointed with the support I am receiving, as I am waiting patiently for a response. I understand my matter may not be urgent, but this is not acceptable to be waiting for such a long time for a simple response. Below, is the code I attempted to use if someone can please correct it and assist me, I will be more than grateful and pleased. I have tried multiple ways, but still haven’t found a solution. Can someone please help me?

[MY PROBLEM]: I want my progress bar to save when I get +5, but it doesn’t.

import wixLocation from ‘wix-location’ ;
import {local} from ‘wix-storage’ ;
$w.onReady( function () {

});
export function button1_click_(event){
let progress = Number(local.getItem( ‘progress’ )) + 5 ;
$w( ‘#progressBar1’ ).value = progress;
local.setItem( ‘progress’ , $w( ‘#progressBar1’ ).value + ‘’ );
[wixLocation.to(](wixLocation.to(“/Next) [”/Next](wixLocation.to("/Next) Level " );

}

If someone can please help me, I would be more than grateful. I am sorry if I came off as rude in this message, but I am just frustrated and upset as this has not worked yet. Thank you!

First, understand that this forum is a community of Corvid developers and users where various topics are discussed and information shared. It is not a support site.

Second, please observe the community guidelines and refrain from multiple posts on the same topic or question.

I don’t understand the problem that you are having. What do you mean by “not saving”? I tried out your code myself and it works fine. Each time I click the button, the progress bar advances by 5.

If by “not saving” you mean that when you go to that page the progress bar doesn’t display the correct value, then perhaps it’s because you are not initializing the progress bar when the page is ready. Just set the progress bar to the value saved in storage like this:

$w.onReady(function () {
$w("#progressBar").value = Number(local.getItem('progress'));
});

To learn about programming with Corvid, read the following articles that will help you start working with Corvid:

  • About Corvid by Wix - what Corvid is and what features it has.

  • Getting Started with Corvid by Wix - step-by-step tutorial on how to start using Corvid.

  • Onboarding to Corvid by Wix - introduction to Corvid with short tutorials.

If you find that you are having difficulty with code and need assistance, you may want to check out the Wix Marketplace - it’s a place where you can look for Corvid experts for hire.

Hello. I am sorry for everything I have caused. When I meant the progress bar isn’t saving, I meant when I went to another page, and back on the page with the progress bar, the value would remain 0. So if I went to page “A” and back to page “B” which was where the progress bar was located, it would say 0 instead of 5!

Can someone please help me?

@thegamerdevilbusines As I explained in the post above, the progress bar isn’t being set on the page which is why it is 0. You need the following:

$w.onReady(function () {
$w("#progressBar").value = Number(local.getItem('progress'));
});

@yisrael-wix Where should I put this code? can you replace what you just sent me with the original code so I know how it is formatted?

@tgrtmgmt Add the following line to the page’s onReady():

$w("#progressBar").value = Number(local.getItem('progress'));

@yisrael-wix And everything else I had was ok, can you please test it and make sure it works? I will no longer bother you with this matter.

@tgrtmgmt As I commented earlier, I did test it and it worked fine. The progress is being save, but your progress bar isn’t showing the saved value because you are not setting it on the page. I posted the code that shows what you need to do to display the updated value.

As I suggested, if you are having difficulty with the code you should find help in the Wix Marketplace .

@yisrael-wix Oh ok, thank you so much

@yisrael-wix Hey! Thank you for everything! Just one last thing. How can I make my button work so that it can only add to the progress bar once. Every time I reload the page, I am able to add 5 again by clicking the button. I want to the progress bar once. Can you please help me? Thanks for everything.