0

I have a form which asks to select a file for upload. PArt of the form requires the user to click through to another page. This is fine as I can store field values in local storage. The problem is the file selection - is there a way to remember what the user selected once they navigate back to the form?

If not can anyone suggest how to implement what I am trying to do?

Thanks

Alex
  • 96
  • 1
  • 2
  • 7
  • 2
    Possible duplicate of [Remember and Repopulate File Input](http://stackoverflow.com/questions/20537696/remember-and-repopulate-file-input) – ndm Jan 30 '16 at 13:39

1 Answers1

0

So as you are not posting some code examples, I assume that your are not interested in code suggestions.

You could use a session to store some data the user gave you over a form. CakePHP comes with the nice session helper, which makes it easy to deal with.

How to use sessions with CakePHP you can find here:

http://book.cakephp.org/3.0/en/development/sessions.html

So everytime the user fills out the form you could store the relevant data inside the session. Inside your view you just check if there is a value for that data in your session. If yes render the session value as default if not you can render the default value.

apxp
  • 5,240
  • 4
  • 23
  • 43