Questions tagged [defaultbutton]
65 questions
23
votes
9 answers
Submit Login control button when I hit Enter
I have an ASP.NET web page with a Login control on it. When I hit Enter, the Login button doesn't fire; instead the page submits, doing nothing.
The standard solution to this that I've found online is to enclose the Login control in a Panel, then…

Ryan Lundy
- 204,559
- 37
- 180
- 211
21
votes
4 answers
Canceling the default submit button in ASP.NET
I have an ASP.NET application where there's a few ASP.NET buttons and several plain HTML buttons. Anytime there's a textbox where a user hits enter, the ASP.NET button tries to submit the form.
I know I can change the defaultButton, but I don't…

Ryan Smith
- 8,344
- 22
- 76
- 103
20
votes
4 answers
How to set the Java default button to react on ENTER key _released_?
In my application I use a Default button. I want it to react when ENTER Key is released. Not when ENTER Key is pressed.
I removed the KeyStroke from InputMap of the button. But it didn't work for me. How should i do that?
import…

Hirantha
- 337
- 1
- 4
- 14
19
votes
3 answers
ASP.NET Master page DefaultButton override
I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. On one of my pages I want to "override" the masterpage defaultbutton attribute by setting the Forms DefaultButton in the Page_Load event.
i.e…

Dieter G
- 930
- 2
- 9
- 24
19
votes
3 answers
enter key in asp.net firing wrong button
I have a text box and many buttons. When user is in some text box and presses the "enter" key then specific button click event is raised. I read on the internet that there are some problems with the "enter" key and I tried few solutions but still it…

Greg Oks
- 2,700
- 4
- 35
- 41
7
votes
4 answers
Specify a default button in Xamarin.Forms
In Xamarin.Forms, how do you designate a button as the default button for a page?
For example, on UWP the click handler for a DefaultButton should fire when the user presses the Enter key while the page has focus.

Edward Brey
- 40,302
- 20
- 199
- 253
5
votes
3 answers
How to set the default button for a TextBox in ASP.Net?
I have a page that has two buttons, btnSearch and btnAddUser. The aspx page is as below. As you can see the default button is btnAddUser. But I would like to set the default button to btnSearch when I type something in the text box txtFilter. I…

GLP
- 3,441
- 20
- 59
- 91
5
votes
3 answers
ASP.NET DefaultButton and MasterPages
In my site i have a search function in the master page (no defaultbutton set there, also not in form). in a content page, i have a login, there i use a asp panel with defaultbutton.
but when i click enter on the login textbox then my site keeps…

Ozkan
- 2,011
- 6
- 29
- 43
5
votes
2 answers
Setting DefaultButton to button.UniqueID throws exception
The problem I'm trying to solve:
I have several text boxes in an asp:Panel. When the user hits Enter from any of those boxes, I want the form to submit as if they've clicked btnAddTag. (When the cursor is not in those boxes, I have a different…

egrunin
- 24,650
- 8
- 50
- 93
5
votes
2 answers
Defaultbutton div
I am just curious; does any of you have any good javascriptresources for setting defaultbutton for all elements inside a div? I have a lot of divs that executes various javascriptfunctions and I would like all of them to have their buttons script…

femseks
- 2,914
- 3
- 23
- 20
5
votes
5 answers
Silverlight 4 Default Button Service
For a few months I have been successfully using David Justices Default Button example in my SL 3 app. This approach is based on an attached property.
After upgrading to SL4, the approach no longer works, and I get a XAML exception:
Unknown parser…

Mark Cooper
- 6,738
- 5
- 54
- 92
5
votes
2 answers
Default button not working in asp.net panel
I have an asp.net panel with a default button setting but the button is never trigger when hitting the ENTER button. I searched SO for this question, but could not find any response that works.
How can I get btnRegister to click when the users…

DNR
- 3,706
- 14
- 56
- 91
4
votes
1 answer
How to disable Qt dialog default button changing with tab navigation
In Qt 4, by default, tabbing through a dialog changes the default button to be the button tabbed to. This makes tabbing look a bit ugly and distracting as extra redraws take place during tab navigation which distract from point of user focus.
Is…

WilliamKF
- 41,123
- 68
- 193
- 295
4
votes
2 answers
Can a custom WPF control implement the IsDefault property
I have a custom button control that does not derive from Button. Is it possible for me to implement the equivalent of IsDefault so that the command associated with my control will be invoked. I was hoping that this was an attached property that I…

jpierson
- 16,435
- 14
- 105
- 149
4
votes
4 answers
Multiple Default Buttons in a User Control
I have a user control that is comprised of 3 textboxes, 3 buttons and a gridview. I can set the defaultbutton property of the form, but that would only affect one button.
Each textbox/button combo should have a behavior that when the textbox has…

Al.
- 43
- 1
- 3