Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to save the data while page refresh  RSS feed

 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am having a page with textbox and select with options so when user selects any option and then refresh I need to display what they have selected.

I was thinking onclick on any event i should add to url paramter but this is not a good idea :-(

Could some one provide me any other inputs.

Thanks,
Shasha
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A refresh will reset any form elements to their original settings as specified by the HTML. Not much you can do about it.
 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

That was the requirement.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requirements that cannot be met are called impossibilities.

Perhaps you can try saving the state of the select in a cookie and restoring it on load.
 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear,

I Just discussed your suggestion with team and decided to disable refresh , ctr-r,crtl-f5.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


No, no, no, no, no!

Please read InterfaceDesignersRule1

Just leave it be! That's the behavior that most people expect. Why tick people off by changing the way that the browser works?
 
ujjwal soni
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can achieve this using Ajax.

If you wish to do it the way Facebook does, you will need to send AJAX requests to another one of your pages at certain intervals, in the case of Facebook, it is every time you send a message. That page parses the AJAX request and updates it in the database. When you refresh the page, the database is called to see what to display in the chat.

The problem with using cookie is the size restriction (Facebook can store days of chat using the database).

You also will not need to worry if the client has cookies disabled because all the information is stored on the server.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see what that has to do with the original question at all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!