Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello;
how do i cache user information in my text-box so users fill there information once, when a user comes back to the same form page, the previous data would be there so he don't have to fill them in again.

this is my form code:


if(Main.checkoutinfo['Last Name'].status == 't'){
b += '
';
b += ' :';
b += '<input type="text" placeholder="" class="field-text" id="buyerlastname2" value="' + Main.NullToEmpty(Shopping.Cart.buyer.lastname2) + '" onkeyup="Shopping.UserUpdate(this,\'lastname2\');Checkout.BrainFieldUpdate(this,\'lastname2\');;" autocomplete="on" />';
b += '
';
}

What I have tried:

i have tried using an autocomplete code, but i haven't tried anything other than that as
Posted
Updated 10-Apr-16 2:15am
v2

You didn't specify the route which the user will take to get back to the page. Was it the same day with a back-button or a month later?

With that missing, you can only ensure the data will persist if you store it server-side (I don't like cookies or flash cookies and there's no guarantee with those, anyway). Then, if you have a means of recognizing the user you can retrieve their data when the page is requested.

Since you can't guarantee what a user will do from any given page (such as how they leave it) you need to store the data as soon as its entered. See AJAX for that kind of capability. AJAX is also another means to request the data - but you still need to store it somewhere between trips to the page.
 
Share this answer
 
Hello,
you can add client side cookies. So set value in cookie
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900