...

View Full Version : Disable textbox input history



yonni
12-08-2006, 11:36 AM
I've seen this done before and examined the source code, but I can't find what I need.
You know when you type into a textbox, most browsers have a list of previous inputs that you've entered that appears below the textbox. I want to get rid of that function, and just type into the textbox without the suggestion box appearing below it. How can I achive this?

Bill Posters
12-09-2006, 12:38 PM
This is a browser feature, so would be disabled/enabled in the browser options/preferences, not via the page code itself.

Check under the privacy or security options in your browser options/preferences.

whizard
12-10-2006, 03:08 AM
The reason you think you've seen it before is because what the browser does is remember what text you've entered into a field with a certain name before. For instance, if the website has this field:

<input type="text" name="first_name" />

and you type "John" in, next time you encouter a text field - on any website - 'named' first_name, the browser will offer 'John' as an option. However, if you go to a different website, and their first name input box looks like this:

<input type="text" name="fname" />

then the browser will not show anything, (unless you've entered information into a "fname" text box before) creating the illusion that the site has turned off the feature.

However, this can only be controlled from the client's computer. If what you are trying to do is remove the feature from your computer, then, as the previous poster said, check your browser options. If you are trying to stop this from happening when other people view a website you are making, there's not much you can do about it.

I suppose you could use a server-side (PHP, PERL or ASP) language to create dynamic (random) input names and pass them along with the data to the parsing script....

Hope this helps!

david_kw
12-10-2006, 04:38 AM
On that basis, couldn't you use javascript to give the textbox a random name?



window.onload = function () {
document.getElementById("text1").name = Math.random();
}
.
.
.
<input type="text" name="xxx" id="text1" />
.


Just hypothesizing.

david_kw

whizard
12-10-2006, 04:42 AM
Your right.. you probably could.

I... think in terms of server side as I'm not a big JS person and I often miss simpler solutions...

Good catch!

david_kw
12-10-2006, 04:53 AM
One minor change since I vaguely recall someone saying names can't start with a number

document.getElementById("text1").name = "R" + Math.random();

david_kw

_Aerospace_Eng_
12-10-2006, 09:02 AM
That would work but Js can be disabled. There is a propietary attribute called autocomplete and setting this to off seems to work though from an accessibility stand point thats not a smart idea. Leave the users interface alone.


<form autocomplete="off">

yonni
12-20-2006, 01:20 PM
use your users interface alone

This is something that for the moment only I am using, and I am doing it because I am making a MySQL command prompt (or have made I should say) and as passwords/etc are typed into this box, I don't want these popping up below the input box every 2 seconds. So this is a rare case where messing with users interface is valid.

sandmanx24
03-07-2009, 06:20 PM
That would work but Js can be disabled. There is a propietary attribute called autocomplete and setting this to off seems to work though from an accessibility stand point thats not a smart idea. Leave the users interface alone.


<form autocomplete="off">

There are cases where it makes perfect sense to eliminate this feature in a textbox, if possible. For example, a testing application, language drills, etc. It would be more helpful if you try to answer the question, not pontificate on what should be done...

Here's an actual answer:

http://forums.asp.net/p/1107643/1698447.aspx

In ASP.Net, set the textbox AutoCompleteType to "Disabled".

_Aerospace_Eng_
03-08-2009, 09:35 AM
There are cases where it makes perfect sense to eliminate this feature in a textbox, if possible. For example, a testing application, language drills, etc. It would be more helpful if you try to answer the question, not pontificate on what should be done...

Here's an actual answer:

http://forums.asp.net/p/1107643/1698447.aspx

In ASP.Net, set the textbox AutoCompleteType to "Disabled".

It would also be helpful if you didn't drag up 3 year old threads. :rolleyes:

Arbitrator
03-08-2009, 09:59 AM
This is something that for the moment only I am using, and I am doing it because I am making a MySQL command prompt (or have made I should say) and as passwords/etc are typed into this box, I don't want these popping up below the input box every 2 seconds. So this is a rare case where messing with users interface is valid.As Bill Posters pointed out, you can disable form auto-completion via the browser interface (which would seem to be appropriate for an application used by only one user).


For example, a testing application, language drills, etc.Don't these things usually take place on controlled computers where browser settings like form auto-completion can be controlled?

ferrit91
12-18-2010, 12:01 AM
<input type="text" name="name" autocomplete="off">
:thumbsup:

alphaOmega
11-18-2011, 11:51 AM
<input type="text" name="name" autocomplete="off">
:thumbsup:

To turn autocomplete off for everything within a form...

<form name="formName" action="pageName.php" method="post" autocomplete="off">

See W3 (http://www.w3schools.com/html5/html5_form_attributes.asp) for more detail

Have fun!

teedoff
11-18-2011, 04:08 PM
To turn autocomplete off for everything within a form...

<form name="formName" action="pageName.php" method="post" autocomplete="off">

See W3 (http://www.w3schools.com/html5/html5_form_attributes.asp) for more detail

Have fun!

Well I would think, since this question was asked 5 years ago, that the OP would already have had all the fun he wanted with his solutions.

alphaOmega
11-18-2011, 05:04 PM
Well I would think, since this question was asked 5 years ago, that the OP would already have had all the fun he wanted with his solutions.
Indeed, but just because he leant how to do it 5 years ago does not preclude others having the same need! ;) Wouldn't a uni-brain be cool? Everyone amassing the same information, but then you'd all know my plans for taking over the world. Doh!


most browsers have a list of previous inputs that you've entered that appears below the textbox.
Yes, that is auto complete - sometimes this gets in the way of the page design. Try for instance to work down a list of textboxes on a web-app, maybe updating a database; you would soon find that auto complete is a PITA! (hint work from bottom of page). Yet turning it off for the whole browser is often anti-productive.

Have fun!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum