473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

prevent dropdown with previous input

When you press the down key while in an input field the default
behavior for some event creates a dropdown of the previously input
text.
What event creates that behavior and how do I stop it ?

For example, to prevent ANY type of default behavior when clicking ANY
key, I thought this would work, but the dropdown still occurs. What am
I doing wrong ?

In html file:<body onload="registersearch()" >
Search Text: <input type='text' id='searchtext' />

in javascript file:
function blank(){
return false;
}
function registersearch(){

document.getElementById("searchtext").onkeyup=blan k;
document.getElementById("searchtext").onkeypress=b lank;
document.getElementById("searchtext").onkeydown= blank;
document.getElementById("searchtext").onclick=blan k;

}

Jun 17 '07 #1
3 2931
On Jun 17, 7:32 am, grou...@reenie.org wrote:
When you press the down key while in an input field the default
behavior for some event creates a dropdown of the previously input
text.
What event creates that behavior and how do I stop it ?
This is a browser feature. Presumably the user chose the browser
because the browser's features are appealing. Yes some of these
browser features are aggravating at times. It isn't really a good idea
to be trying to change how the browser works. I don't know if you can
even have any affect on this situation.

Peter

Jun 17 '07 #2
Peter Michaux said the following on 6/17/2007 5:23 PM:
On Jun 17, 7:32 am, grou...@reenie.org wrote:
>When you press the down key while in an input field the default
behavior for some event creates a dropdown of the previously input
text.
What event creates that behavior and how do I stop it ?

This is a browser feature. Presumably the user chose the browser
because the browser's features are appealing. Yes some of these
browser features are aggravating at times. It isn't really a good idea
to be trying to change how the browser works. I don't know if you can
even have any affect on this situation.
It is an auto-fill feature and no, you can't have any effect on it's
behavior.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 18 '07 #3
On Jun 17, 9:37 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Peter Michaux said the following on 6/17/2007 5:23 PM:
On Jun 17, 7:32 am, grou...@reenie.org wrote:
When you press the down key while in an input field the default
behavior for some event creates a dropdown of the previously input
text.
What event creates that behavior and how do I stop it ?
This is a browser feature. Presumably the user chose the browser
because the browser's features are appealing. Yes some of these
browser features are aggravating at times. It isn't really a good idea
to be trying to change how the browser works. I don't know if you can
even have any affect on this situation.

It is an auto-fill feature and no, you can't have any effect on it's
behavior.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
Ok thanks. I found out I can trick the autocomplete into not appearing
by having a start value of ' '. The autocomplete doesn't seem to work
at all if the first letter is a blank, even if previous searches
started with a blank. After that it will only appear if the user
deletes everything in the field, which doesn't usually happen, so it
effectively solves the problem.

The input field is for text to search for in an associated drop down,
to make it easier to find the right item in the dropdown. As each
letter is entered the selection moves to the correct choice in the
dropdown. In other words, it acts like autocomplete but instead of
adding the finished text to the input field, it hilights the finished
text in the dropdown. The default autocomplete just gets in the way.
I just have to make sure the search for the right item can work even
if the first letter is a blank, plus it must ignore the blank. But all
that was easy because all the search does is check to see where the
text lands alphabetically in the select list, and this automatically
ignores the spaces. In other words, " ABC" is effectively the same as
"ABC"

This is not for web customers, it is for people who spend all day on
the page filling phone orders. I'm trying to eliminate as many
keystrokes as possible, and the autocomplete takes an extra mouse
click to get rid of it.
Jun 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: middletree | last post by:
For an ASp Intranet app, I have some code that should work, but I am not able to make it happen for some reason, after spending considerable time on this. I am pretty thick when it comes to...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
1
by: Vijay Kerji | last post by:
Hi, I have a datagrid with dropdown list and Remove hyperlink in it as columns. When I remove a row from the datagrid, Dropdown list selection is retaining its previous value. i.e, removed...
1
by: gary | last post by:
In our site we are encountering problems with drop down boxes. We have a dropdown box & the ONChange event of which is fetching some data from a servlet. However when we use history back button ,...
11
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked....
4
by: Greg Scharlemann | last post by:
I'm trying to setup a dyamic dropdown list that displays a number of text fields based on the selected number in the dropdown. The problem I am running into is capturing the data already entered...
0
by: josephkorn | last post by:
Hi all. I have a problem in my website in trying to prevent a user from double submitting the form. I am calling a subroutine from my page_load event that passes in the commandbutton that I want...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
11
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.