473,387 Members | 1,516 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,387 software developers and data experts.

Highlited default key does not work. Can any one explain this ?

Thanks for taking the time to read this note

Can anyone explain what went wrong and any ideas how to fix it

I have a search page With three buttons few drop downs and a textbox. The search Button is the default button (because it is the first control in the HTML

When anything is entered into the text box the button is highlighted automatically. Hitting the enter key the event handler for this button btnSearch_click is executed. This worked fine for a few times and then something changed. Now it does not work

Here's what happens. When the button is highlighted by default (when a textpox gets focus and anything is entered)
hitting enter key nothing happens. I set break points and it does execute page load event so it posts the form back but does not execute the event btnSearch_click

When button is set to focus by tabbing to it (highlited by a dashed box) and hit the enter key, the event btnsearch_click executes

When the button is clicked with the mouse the event btnSearch_click executes

Nov 18 '05 #1
2 1273
its a bug in IE. there are cases when hitting enter (depending on the mix of
controls), that it fail to post the button name, thus the o click does not
fire.

in your post back code, you can check if none of the buttons are in the
posted form data, then fire the click event your self.

if (this.IsPostBack)
{
bool buttonClicked = false;
foreach(string key in this.Request.Form.Keys)
{
if (string.Compare(key,"button1",true) == 0
&& (string.Compare(key,"button2",true) == 0
&& (string.Compare(key,"button3",true) == 0)
buttonClicked = true;
}

if (buttonClicked)
// do click i want
}

-- bruce (sqlwork.com)
"makthar" <an*******@discussions.microsoft.com> wrote in message
news:E9**********************************@microsof t.com...
Thanks for taking the time to read this note.

Can anyone explain what went wrong and any ideas how to fix it.

I have a search page With three buttons few drop downs and a textbox. The search Button is the default button (because it is the first control in the
HTML)
When anything is entered into the text box the button is highlighted automatically. Hitting the enter key the event handler for this button
btnSearch_click is executed. This worked fine for a few times and then
something changed. Now it does not work.
Here's what happens. When the button is highlighted by default (when a textpox gets focus and anything is entered) hitting enter key nothing happens. I set break points and it does execute page load event so it posts the form back but does not execute the event
btnSearch_click.
When button is set to focus by tabbing to it (highlited by a dashed box) and hit the enter key, the event btnsearch_click executes.
When the button is clicked with the mouse the event btnSearch_click executes.

Nov 18 '05 #2
Thanks I will try it.
Nov 18 '05 #3

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

Similar topics

46
by: J.R. | last post by:
Hi folks, The python can only support passing value in function call (right?), I'm wondering how to effectively pass a large parameter, such as a large list or dictionary? It could achieved...
3
by: CoolPint | last post by:
Can anyone explain how I can make the following function accept an default arguement for the last parameter, which should be an optional functor? template <typename T, typename FUNCTOR> void...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
36
by: spence | last post by:
Hi All How do I make it so that when a user clicks in a search text field, the default entry (in this case "Search") is removed automatically - they are then faced with a blank search box and...
12
by: Emi Lu | last post by:
Hello all, I have a question about "date" & "timestamp" types in PostgreSQL. I want to setup the default value '0000-00-00' and "0000-00-00 00:00:00" for them. However, it seems that PostgreSQL...
12
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
2
by: Calm_Pear | last post by:
Hi all, I have created an object with a default function; the default function exposes a public function as well. myobject = function(){
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.