Reputation: 65
I made a registration webpage for my project but i want to store the details in local storage but it doesn't seem to save the phone number and address details. I've checked the developer tools in Google Chrome (only browser i prefer to use) and it shows only the username, password, and email address being saved into local storage... any suggestions??
Upvotes: 1
Views: 289
Reputation: 5670
It looks to me like you are accidentally using "Password" three times. It should also be affecting address.
localStorage.PassWord = passW;
var address = document.getElementById("Address1").value;
localStorage.PassWord = address;
var phoneN = document.getElementById("PhoneNumber").value;
localStorage.PassWord = phoneN;
Change it to:
localStorage.PassWord = passW;
var address = document.getElementById("Address1").value;
localStorage.Address = address;
var phoneN = document.getElementById("PhoneNumber").value;
localStorage.PhoneNumber = phoneN;
Upvotes: 2