Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 227 results for
localstorage
- Page 1
localStorage returns 'undefined' in deleted values in input and textarea
Programming
Web Development
9 Years Ago
by gentlemedia
… form where I save the data in a cookie with
localStorage
. This all works fine, but If clear (just deleting with…;/textarea> </div> </form> The jQuery/
localStorage
to save and return the data: $(function() { $.each($('.stored'), function…
Re: localStorage returns 'undefined' in deleted values in input and textarea
Programming
Web Development
9 Years Ago
by gentlemedia
… and textarea fields: $('.stored').on('keyup focusout', function() {
localStorage
[$(this).attr('name')] = $(this).val(); }); $('select').on('change',… function() {
localStorage
[$(this).attr('name')] = $(this).find('option:selected').val(); }); I…
Re: localStorage returns 'undefined' in deleted values in input and textarea
Programming
Web Development
9 Years Ago
by gentlemedia
It's solved. Not sure what I was thinking by using `||` instead of just the`,` to combine them. $('.stored').change(function() {
localStorage
[$(this).attr('name')] = $(this).val(), $(this).find('option:selected').val(); });
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by riahc3
… on a checkbox, if the checkbox is true, something (cookie,
localstorage
, session, etc) must be stored that can be accessed EVERYWHERE… to the cookie problem) and thats why Im trying with
localstorage
....
localStorage and PHP
Programming
Web Development
12 Years Ago
by riahc3
I want to use a
localStorage
variable in a PHP page. Very simple but "strange". AJAX comes to mind. Whats the best form to do this? Thanks
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by pritaeas
Something like this if you use jQuery: $.ajax({ type: "POST", url: "example.php", data: { storageValue:
localStorage
.getItem("yourValue"); } }); In PHP you'd use `$_POST['storageValue']`
Unable to store radio button state (:checked) or value in localStorage
Programming
Web Development
8 Years Ago
by gentlemedia
…or checkboxes with the class 'stored' in
localStorage
I've tried to extend that on …change function with several ways such as:
localStorage
[$(this).attr('name')] = $(this).val(), $(this…following, but also nothing if ($('.stored').is(':checked')) {
localStorage
[$(this).attr('name')] = $(this).val(); }; So how…
Loop thru localStorage?
Programming
Web Development
12 Years Ago
by riahc3
Hello Lets say in the
localStorage
object I have the following: Apple = red Potato = brown Gum = …: for (var i=0;i<
localStorage
.length();i++) { if (
localStorage
[i]=="Potato") { var somevariable=
localStorage
[i].value(); break; } } Forgive sintaxis…
store several inputs in localstorage
Programming
Game Development
2 Years Ago
by Nicolas_14
…: totalSuccess, date: new Date().getTime() } let localData =
localStorage
.getItem('score') + JSON.stringify(score);
localStorage
.setItem("score", localData); thanks in advance…
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by IIM
you can also use session as session is easy to maintain. http://php.net/manual/en/function.session-start.php
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by armie340
that's it!!
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by pritaeas
To get the local storage variable to PHP you'll have to use an AJAX call. Whether you use a GET or POST is up to you. Personally, I'd choose a POST.
Re: localStorage and PHP
Programming
Web Development
12 Years Ago
by riahc3
> To get the local storage variable to PHP you'll have to use an AJAX call. Whether you use a GET or POST is up to you. Personally, I'd choose a POST. What would be the best way to do this then? example.php <?php echo "hi" $var=getlocalstoragehere.php; echo $var ?> Lets say that the page I use. …
Re: Unable to store radio button state (:checked) or value in localStorage
Programming
Web Development
8 Years Ago
by diafol
Here's my feeble attempt - seems to work, but I'm sure I'm missing something simple: http://codepen.io/anon/pen/amwrVv#anon-login
Re: Unable to store radio button state (:checked) or value in localStorage
Programming
Web Development
8 Years Ago
by gentlemedia
Thanks, Diafol! I know I go wrong with using `name`, because the radio buttons do have of course the same `name`, but I couldn't figure out what to use instead for the them. Your solution works well for me too, because I've tried long enough :)
Re: Loop thru localStorage?
Programming
Web Development
12 Years Ago
by LastMitch
>And I want to search thru it for the word Potato and then get its value (brown). Is this in an array? or from the database? You can read more about this here: http://diveintohtml5.info/storage.html >Forgive sintaxis errors as I just thought it up in 15 seconds. You can read this: http://coding.smashingmagazine.com/2010/10/11/local-…
Re: Loop thru localStorage?
Programming
Web Development
12 Years Ago
by imBaCodes
Use a 2D array ..
fade in divs whenever user get to bottom - offset
Programming
Web Development
11 Years Ago
by klemme
… til 180px fra bunden {
localStorage
.initOffset ++; // Increment initOffset
localStorage
.limitTo =
localStorage
.initOffset *
localStorage
.limitClause; // Afgræns op til
localStorage
.limitFrom =
localStorage
.limitTo -
localStorage
.limitClause; // Udtræk fra…
To-Do List
Programming
Web Development
9 Years Ago
by Ian David
…Y.config.win.
localStorage
) {
localStorage
= Y.config.win.
localStorage
; } var data = Y.JSON.parse((
localStorage
&&
localStorage
.getItem(key)) ….Object.values(data); } function save() {
localStorage
&&
localStorage
.setItem(key, Y.JSON.stringify(data)); } …
Hello Good AfterNoon To all Small Help Needed
Programming
Web Development
12 Years Ago
by Venter
…my code..thank u all } i++; } alert(
localStorage
.fruitname); } function fun() { alert(
localStorage
.Apple); // here it will displaying alert as 'undefined… 'SELECTED' my requirement is i want to dispaly the alert(
localstorage
.Apple) as SELECTED... } </script> </head>…
Re: keeping Sortable order on refresh
Programming
Web Development
10 Years Ago
by piers
… only able to set the current order as default in
LocalStorage
. How would you do this? var current_order = { 'set_1' : 0,…", JSON.stringify(current_order)); } $(function(){ var returningValues = JSON.parse(
localStorage
.getItem("sorted")); console.log("returning"+returningValues…
keeping Sortable order on refresh
Programming
Web Development
10 Years Ago
by piers
…{ // I get the order from
localStorage
var saved =
localStorage
.getItem("sorted"); // I get…this).sortable( "serialize", { key: "set_" } );
localStorage
["sorted"] = sorted; } }); }); $( "#container" …
Re: keeping Sortable order on refresh
Programming
Web Development
10 Years Ago
by piers
…JSON.stringify(current_order)); } else{ current_order = JSON.parse(
localStorage
.getItem("sorted")); } $(function(){ $( "…).attr("id")] = $(this).index(); }).get();
localStorage
.setItem("sorted", JSON.stringify(current_order)); } }); });…
Re: Login and registration using local storage
Digital Media
UI / UX Design
11 Years Ago
by rtrethewey
…document.getElementById('welcomeMessage').innerHTML = "Welcome " +
localStorage
.getItem('username') + "!"; return false; } //…inputPassword.value; if ((username ==
localStorage
.getItem('username')) && (password ==
localStorage
.getItem('password'))) { document.getElementById('welcomeMessage…
Re: keeping Sortable order on refresh
Programming
Web Development
10 Years Ago
by AleMonteiro
…with default values if (JSON.parse(
localStorage
.getItem("sorted"))== " ") {
localStorage
.setItem("sorted", JSON.stringify… } $(function(){ // Get last saved order current_order = JSON.parse(
localStorage
.getItem("sorted")); console.log("returning"+current_order…
Getting-a-File-to-Download-In-HTML-On-Client-Side
Programming
Web Development
12 Years Ago
by thak123
… if(!
localStorage
.length==0) { for (i=0; i<=
localStorage
.length-1; i++) { keyinput=
localStorage
.key(…: store pageno as key. valinput=
localStorage
[keyinput]; //make dynamic: store user…
renderGrid() data not working
Programming
Web Development
12 Years Ago
by jackbauer24-2
…function(){ var searchKey = $("#searchBox").val(); var item =
localStorage
.getItem(searchKey); item = JSON.parse(item); makeTableOnSearch(item); }); function…to local storage, I can even access it using
localStorage
.getItem(); but the search item just gives me "…
Re: Hello Good AfterNoon To all Small Help Needed
Programming
Web Development
12 Years Ago
by gon1387
Hi Venter, Here you are :) for (var i=0;i<fruits.length; i++) { if(fruits[i]==y) {
localStorage
[fruits[i]]="SELECTED"; } } Let me know if you have questions.
html local storage, caching interface and reseting it, having some problems
Programming
Web Development
12 Years Ago
by wonderland
…('itemfilter'); $(edit).click(function() {
localStorage
.setItem('todoData', this.innerHTML); }); // when… the page loads if (
localStorage
.getItem('todoData') ) { edit.innerHTML =
localStorage
.getItem('todoData'); } $("#reset…
Login and registration using local storage
Digital Media
UI / UX Design
11 Years Ago
by powerson65
… document.getElementById("password");
localStorage
.setItem("username", inputUsername.value);
localStorage
.setItem("password", inputPassword.…function login() { var inputUsername =
localStorage
.getItem("username"); var inputPassword =
localStorage
.getItem("password"); if (…
1
2
3
4
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
Backlink Auditor
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC