Skip to main content

Questions tagged [button]

Buttons are simple elements in graphical user interfaces that take mouse clicks or finger taps (on touch devices) as input.

2717 votes
37 answers
9.8m views

How do I create an HTML button that acts like a link?

How do I create an HTML button that acts like a link? So that clicking the button redirects the user to a page. I want it to be accessible, and with minimal extra characters or parameters in the URL.
Andrew's user avatar
  • 235k
1901 votes
17 answers
695k views

<button> vs. <input type="button"> -- which to use?

When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <button></button> What are the main differences between the two, if any? Are ...
Aron Rotteveel's user avatar
1463 votes
31 answers
1.8m views

Trigger a button click with JavaScript on the Enter key in a text box

I have one text input and one button (see below). How can I use JavaScript to trigger the button's click event when the Enter key is pressed inside the text box? There is already a different submit ...
kdenney's user avatar
  • 18.5k
690 votes
8 answers
485k views

Can I make a <button> not submit a form?

I've got a form, with 2 buttons <a href="index.html"><button>Cancel changes</button></a> <button type="submit">Submit</button> I use jQuery UI's button on them ...
alex's user avatar
  • 487k
579 votes
19 answers
629k views

Android: combining text & image on a Button or ImageButton

I'm trying to have an image (as the background) on a button and add dynamically, depending on what's happening during run-time, some text above/over the image. If I use ImageButton I don't even have ...
znq's user avatar
  • 44.8k
461 votes
19 answers
277k views

How to handle button clicks using the XML onClick within Fragments

Pre-Honeycomb (Android 3), each Activity was registered to handle button clicks via the onClick tag in a Layout's XML: android:onClick="myClickMethod" Within that method you can use view.getId()...
smith324's user avatar
  • 13.1k
427 votes
8 answers
547k views

Tooltips for Button elements

Is it possible to create a tooltip for an html button. Its the normal HTML button and there is no Title attribute as it is there for some html controls. Any thoughts or comments?
SARAVAN's user avatar
  • 14.9k
387 votes
8 answers
382k views

How to make button look like a link?

I need to make a button look like a link using CSS. The changes are done but when I click on it, it shows as if it's pushed as in a button. Any idea how to remove that, so that the button works as a ...
user avatar
349 votes
18 answers
374k views

How do I disable a Button in Flutter?

I'm having trouble figuring out how to set the enabled state of a button in Flutter. From the docs, it says to set onPressed to null to disable a button, and give it a value to enable it. This is fine ...
chris84948's user avatar
  • 4,250
331 votes
13 answers
213k views

React onClick function fires on render

I pass 2 values to a child component: List of objects to display delete function. I use a .map() function to display my list of objects(like in the example given in react tutorial page), but the ...
Stralos's user avatar
  • 4,995
275 votes
14 answers
487k views

How to pass arguments to a Button command in Tkinter?

Suppose I have the following Button made with Tkinter in Python: import Tkinter as Tk win = Tk.Toplevel() frame = Tk.Frame(master=win).grid(row=1, column=1) button = Tk.Button(master=frame, text='...
Jack's user avatar
  • 5,384
274 votes
6 answers
375k views

Best way to disable button in Twitter's Bootstrap [duplicate]

I am confused when it comes to disabling a <button>, <input> or an <a> element with classes: .btn or .btn-primary, with JavaScript/jQuery. I have used a following snippet to do that:...
user avatar
271 votes
14 answers
652k views

How to center buttons in Twitter Bootstrap 3?

I am building a form in Twitter Bootstrap but I'm having issues with centering the button below the input in the form. I have already tried applying the center-block class to the button but that didn'...
Sam Bates's user avatar
  • 2,817
270 votes
21 answers
186k views

How to remove padding around buttons in Android?

In my Android app, I have this layout: <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="...
omega's user avatar
  • 42.9k
261 votes
28 answers
194k views

Coloring Buttons in Android with Material Design and AppCompat

Before the AppCompat update came out today I was able to change the color of buttons in Android L but not on older versions. After including the new AppCompat update I am unable to change the color ...
mail929's user avatar
  • 2,768

15 30 50 per page
1
2 3 4 5
2716