Hi again, so Im playing with the toggle switch and making progress, but Im stuck on a couple issues: 1) it doesnt turn back to on when value changes; and 2) its not storing the correct value into localSTorage for me. So, heres my final code that Im running on Value Change:
-----------------------------------------------------------------
var a = Appery('pro19_auto_checkin');
localStorage.setItem('pro19_auto_checkin', a);
if (a == 'on') {
Appery('change_on_off').hide();
}
else Appery('change_on_off').show();
-----------------------------------------------------------------
1):
So, what it does is that lets say the initial state is On. Then I toggle it to Off. That part works and hides 'change_on_off' but when I try to turn the toggle back to On it does not hide 'change_on_off'
Is there an issue running the JS off of Value Change or there a better event to run it off of? Or is there something wrong with my code?
2):
The value of localStorageItem 'pro19_auto_checkin' is always '[object Object]' - I need it to be either 'on' or 'off' depending on the state. WHat is wrong here and why am I getting such an odd value? And how do i fix this issue?