What you want is to disable the HTML autocomplete attribute.
Setting autocomplete = "off" here has two effects:
It does not allow the browser to save field data for subsequent autofill in similar forms, although heuristic parameters depend on the browser. It does not allow the browser to cache form data in the session history. When the form data is cached in the session history, the information filled in by the user will be visible after the user submits the form and clicks the "Back" button to return to the original form page.
Learn more about MDN
Here is an example of how to do this.
<form action="#" autocomplete="on"> First name:<input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> E-mail: <input type="email" name="email" autocomplete="off"><br> <input type="submit"> </form>
If it is on a React platform, use the following:
<input id={field.name} className="form-control" type="text" placeholder={field.name} autoComplete="off" {...fields}/>
Link to respond to documents
Refresh
Here's an update to fix some browsers skipping the "autocomplete = off" flag.
<form action="#" autocomplete="off"> First name: <input type="text" name="fname" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');"><br> Last name: <input type="text" name="lname" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');"><br> E-mail: <input type="email" name="email" autocomplete="off" readonly onfocus="this.removeAttribute('readonly');"><br> <input type="submit"> </form>
source share