1

I want to ask a question about the html code. I have a input type="text". And I have added the auto-complete function in the text box (like the google suggestion list). However, when I click the text and start the to type the text, it display 2 auto-complete function.

  1. browser e.g. like you type your account in the browser to login somewhere, and other time you go the text, it will appear to you for you to select.

  2. my implementation of the auto-complete function.

I want to disable the 1. and keep the 2. Is it possible to do that by using web programming rather than set the browser setting. thank you.

1

2 Answers 2

3

In addition to the (Unfortunately not W3C valid) autocomplete="off" method mentioned in the duplicate link, a server-side possibility to do this is to change the field's ID and name on every request. This will make it impossible for the browser to keep a history.

However, that will probably still show autocomplete entries from just a second ago.

Sign up to request clarification or add additional context in comments.

Comments

0

By Using Jquery (W3C Valid)

//Try this one:

    $(document).ready(function(){
    $("input.autocompleteOff").attr("autocomplete","off");
    });

//For all textbox -

    $(document).ready(function(){$("input").attr("autocomplete","off");});

//HTML

<input type="text" name="field" id="field" class="autocompleteOff" />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.