1

I need someone to please tell me how to remove this auto-suggested text below the input field. I have tried autocomplete="off" , autocomplete="false". I've also placed <form autocomplete="off"></form> in form tag.

Anyone with a solution please help.

<div class="col-md-6">
    <div class="form-group">
        <span class="label">Enter Postal Code</span>
        <input type="text" class="form-control" id="search_input" autocomplete="off" placeholder="Type postal code ..." required>
    </div>
</div>

see image here

freedomn-m
  • 27,664
  • 8
  • 35
  • 57
theduke
  • 11
  • 2

2 Answers2

1

Here you can see which browsers support the autofill attribute CaniUse. Here is a simple work around from this source: Turning off form-autocompletion.

You can work around with autofill="new-password"

"If you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use autocomplete="new-password"."

<form method="post" action="/form">
  <div>
    <label for="cc">Enter Postal Code:</label>
    <input type="text" id="cc" name="cc" autocomplete="new-password">
  </div>
</form>

Lastly, instead of pairing a <span> with the input element, it is common practice to use the <label> element. Please read more here label

BeerusDev
  • 1,444
  • 2
  • 11
  • 30
0

Apply autocomplete="off" to your form not the input box.