www.webdeveloper.com
Results 1 to 3 of 3

Thread: Can I disable the Firefox search suggestion drop down using Js?

  1. #1
    Join Date
    Jul 2008
    Location
    Bristol
    Posts
    77

    Can I disable the Firefox search suggestion drop down using Js?

    I am working on a site that utilizes a search drop down suggestion menu (similar to Google) on the search box but Firefox is sticking its own over the top - displaying words that I have previously used for various websites in other search boxes. Now, I guess there is a way to turn it off in the prefs but I need to override it using javascript.

    Does anyone know a way of doing this, if it is even possible? It only seems to be FF that implements this method of word suggestion.

    Thanks in advance,
    Michael

  2. #2
    Join Date
    Oct 2007
    Location
    Western Massachusetts, USA
    Posts
    387
    The best solution I can think of right now is to dynamically set the value of a hidden text field in a form, via unblur. This way, when the user clicks Search, unblur is called for the textbox outside the form (so no form completion?) to copy its own value into a hidden value in the actual search form.
    HTML Code:
    <input type="text" id="searchtext" onblur="document.searchForm.realsearchtext.value = document.getElementById('searchtext').value;">
    <form action="somewhere" method="get" name="searchForm">
    <input type="hidden" name="realsearchtext">
    <input type="submit" value="Search">
    </form>
    Computer programmer / web developer.

  3. #3
    Join Date
    Jul 2008
    Location
    Bristol
    Posts
    77
    Thanks for your reply, but this method does not work. Mainly because the pop up appears whilst you're typing in the search box itself (also this code causes errors in IE, but what's new?)

    Anyway I have attached a screen capture of what is happening to give a better idea of what I mean. Ignore the text - it's irrelevant, but the point is that the pop up that suggests a possible word covers my OWN pop up menu and this is annoying that FF does this.

    Please refer to the attachment

    Thanks again
    Michael

    Quote Originally Posted by savvykms View Post
    The best solution I can think of right now is to dynamically set the value of a hidden text field in a form, via unblur. This way, when the user clicks Search, unblur is called for the textbox outside the form (so no form completion?) to copy its own value into a hidden value in the actual search form.
    HTML Code:
    <input type="text" id="searchtext" onblur="document.searchForm.realsearchtext.value = document.getElementById('searchtext').value;">
    <form action="somewhere" method="get" name="searchForm">
    <input type="hidden" name="realsearchtext">
    <input type="submit" value="Search">
    </form>
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles