Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Jul 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disable textbox input history

    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?

  • #2
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    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.

  • #3
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    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!
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #4
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    On that basis, couldn't you use javascript to give the textbox a random name?

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

    david_kw

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    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!
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #7
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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.

    Code:
    <form autocomplete="off">
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #8
    New Coder
    Join Date
    Jul 2005
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spare the philosophy and answer the question.

    Quote Originally Posted by _Aerospace_Eng_ View Post
    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.

    Code:
    <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".
    Last edited by sandmanx24; 03-07-2009 at 05:24 PM. Reason: More Complete answer

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Quote Originally Posted by sandmanx24 View Post
    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.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,306
    Thanks
    29
    Thanked 277 Times in 271 Posts
    Quote Originally Posted by yonni View Post
    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).

    Quote Originally Posted by sandmanx24 View Post
    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?
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #12
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to stop it.

    <input type="text" name="name" autocomplete="off">

  • #13
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ferrit91 View Post
    <input type="text" name="name" autocomplete="off">
    To turn autocomplete off for everything within a form...

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

    See W3 for more detail

    Have fun!

  • #14
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Quote Originally Posted by alphaOmega View Post
    To turn autocomplete off for everything within a form...

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

    See W3 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.
    Teed

  • #15
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by teedoff View Post
    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!

    Quote Originally Posted by xuandma View Post
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •