473,804 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="registe rsearch()" >
Search Text: <input type='text' id='searchtext' />

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

document.getEle mentById("searc htext").onkeyup =blank;
document.getEle mentById("searc htext").onkeypr ess=blank;
document.getEle mentById("searc htext").onkeydo wn= blank;
document.getEle mentById("searc htext").onclick =blank;

}

Jun 17 '07 #1
3 2963
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.javas cript 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.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.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
2946
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 javascript; I just don't get the syntax at all. If anyone could help, I would appreciate it. I'm probably pretty close. Please note that because it's an Intranet, all users have to use IE 5 or higher. Situation: 3 form fields on an ASP. <select>...
6
10700
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. Let's say you select 1 of the items, and are properly redirected. You press the back button. I have three servers providing two different functionalities: 1. After pressing the back button, the item you selected in the dropdown is still selected.
1
1967
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 Dropdown item selection is applied to the next dropdown list. Is there any way to fix this problem?
1
1858
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 , the data of previous page is displayed correctly but the dropdown selected index always lags behind by one. For instance if the selected index of dropdown is 1 data relating to it is diplayed on table, if second option is selected a call to...
11
4257
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. How I stop the buttons from posting back when they are clicked? Thanks
4
2638
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 before the list is repopulated. For example, suppose the user selects 3 in the drop down list and 3 text fields are shown. If the user populates the 3 text fields with data and decides to change the drop down to a list of 4 or 5, how do I capture...
0
6198
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 to prevent users from being able to click twice. Everything is working great, except for one small detail. When my client-side validation fires, and is invalid, I see the red text that displays the error message, but the problem is that something is...
4
4592
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 reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
11
4647
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. category which comes from database 2. brand which comes from databse according to content of first dropdown . and 3. price which is static. when i am doing these things without ajax on every onChange() thw whole page is refreshing that i do not...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.