1

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??

1 Answer 1

2

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;
1
  • Haha, i am absolutely knackered. But this is the learning curve i guess, spot small things to make big things. Thanks alot anyways! @mseifert
    – A.Adams
    Dec 8, 2016 at 2:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.