HTML - input value kept after Refresh

Viewed 68445

Usually, when a refresh is made on an HTML page, the values for input fields are kept (unless you do Ctrl+F5).

Is there a header or other type of setting than can change this behavior, without chaging anything on the form or input itself?

I have a site where the input value is not kept after a page refresh in Production. However I do not have this behavior when I test this code on my local machine.

6 Answers

I got this solved.

Work Around:

  1. Add a boolean flag to your typescript file and set disable(false) by default
  2. Place *ngIf on your html
  3. On ngAfterViewInit() set that to true
Related