3,328 questions
2763
votes
37
answers
10.1m
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.
1925
votes
17
answers
708k
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 there ...
703
votes
8
answers
501k
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 ...
187
votes
8
answers
223k
views
Android: ListView elements with multiple clickable buttons
I've a ListView where every element in the list contains a TextView and two different Buttons. Something like this:
ListView
--------------------
[Text]
[Button 1][Button 2]
--------------------
[...
78
votes
5
answers
128k
views
Difference between h:button and h:commandButton
In JSF 2, what is the difference between h:button and h:commandButton ?
170
votes
11
answers
431k
views
How do I make an HTML button not reload the page
I have a button (<input type="submit">). When it is clicked the page reloads. Since I have some jQuery hide() functions that are called on page load, this causes these elements to be hidden ...
120
votes
6
answers
274k
views
How do you change Background for a Button MouseOver in WPF?
I have a button on my page with this XAML:
<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Width="50" Height="50&...
395
votes
8
answers
398k
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 ...
0
votes
3
answers
2k
views
Why my show hide button needs double-click on first time
I have this show/hide button on my website. It works, but on the first time the user needs to double-click it as if the switch is set to "hide" but the element is already hidden...
I'd like to edit ...
56
votes
12
answers
154k
views
How to change the foreground or background colour of a Tkinter Button on Mac OS X?
I've been working through the Tkinter chapters in Programming Python and encountered a problem where the foreground and background colours of a button will not change. I am working on a Mac OS X 10.6 ...
581
votes
19
answers
631k
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 ...
97
votes
10
answers
549k
views
Get the contents of a table row with a button click
I need to extract the details of each column in my table. For example, column "Name/Nr.".
The table contains a number of addresses
The very last column of each row has a button that lets a user choose ...
207
votes
6
answers
176k
views
How can I build multiple submit buttons django form?
I have form with one input for email and two submit buttons to subscribe and unsubscribe from newsletter:
<form action="" method="post">
{{ form_newsletter }}
<input type="submit" name="...
94
votes
1
answer
384k
views
"A namespace cannot directly contain members such as fields or methods" [closed]
I am trying to use this code for NET.reflector using Reflexil. I am trying to replace code with this:
if(Input.GetKeyDown(KeyCode.Keypad5)) {
int i = 0;
Character localPlayer = PlayerClient....
236
votes
24
answers
246k
views
How to hide close button in WPF window?
I'm writing a modal dialog in WPF. How do I set a WPF window to not have a close button? I'd still like for its WindowState to have a normal title bar.
I found ResizeMode, WindowState, and ...
150
votes
3
answers
71k
views
How to add a custom button state
For instance, the default button has the following dependencies between its states and background images:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas....
53
votes
12
answers
519k
views
How to click an element in Selenium WebDriver using JavaScript?
I have the following HTML:
<button name="btnG" class="gbqfb" aria-label="Google Search" id="gbqfb"><span class="gbqfi"></span></...
203
votes
11
answers
1.0m
views
Embed image in a <button> element
I'm trying to display a png image on a <button> element in HTML.
The button is the same size as the image, and the image is shown but for some reason not in the center - so it's impossible to ...
24
votes
8
answers
51k
views
How to prevent multiple form submission on multiple clicks in PHP
How to prevent multiple form submission on multiple clicks in PHP
90
votes
6
answers
152k
views
Android ImageButton with a selected state?
If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but ...
72
votes
8
answers
57k
views
Android: Using findViewById() with a string / in a loop
I'm making an android application, where there is a view composed of hundreds of buttons, each with a specific callback. Now, I'd like to set these callbacks using a loop, instead of having to write ...
85
votes
6
answers
220k
views
Change color of Button when Mouse is over
I want to change the background color of a button when IsMouseOver == True
<Button Command="{Binding ClickRectangleColorCommand}" Background="{Binding Color, Converter={StaticResource ...
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 ...
53
votes
11
answers
148k
views
Call method when home button pressed
I have this method in one of my Android Activities:
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if(keyCode == KeyEvent.KEYCODE_BACK)
{
Log.d("Test", "Back button ...
159
votes
4
answers
137k
views
Difference between <input type='submit' /> and <button type='submit'>text</button>
There are many legends about them. I want to know the truth. What are the differences between the two following examples?
<input type='submit' value='text' />
<button type='submit'>text<...