I am displaying data from my database in an HTML form to make it editable by the user.
<input type="text" id="name" placeholder="Name" required = " true" value = <?php if(isset($_SESSION['name'])) echo $_SESSION['name'] ;?>>
There is a reason why I had to use session storage. The problem here is, when I refresh the page, it displays the old value stored in the session. Is there a way to explicitly clear the form while its loaded? I tried JavaScript and jQuery reset(), that doesn't work as its not a user input tht can be cleared.
Edit. This is not a case dealing with auto complete, to be more precise , I have another form to read an unique id which I use to query from the data base . The database results are stored in the session storage and I'm echoing them to the 2nd form.