Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two different submit buttons on the same line

I have two submit buttons part of two different forms. They are being displayed on two different lines. Is it possible to have them, side by side on a single line.

<form action="" method="POST">
        <input type="submit" name = "" value="OK" >
                    </form> 
<form action="" method="POST">
        <input type="submit" name = "" value="Cancel" >
                    </form>
like image 752
Ali Avatar asked Jul 30 '10 22:07

Ali


People also ask

How do you put two buttons on the same line?

If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

Can one form have two submit buttons?

yes, multiple submit buttons can include in the html form. One simple example is given below.

Can you have multiple submit buttons in a form PHP?

Having multiple submit buttons and handling them through PHP is just a matter of checking the the name of the button with the corresponding value of the button using conditional statements. In this article I'll use both elseif ladder and switch case statement in PHP to handle multiple submit buttons in a form.


1 Answers

The other way is to change the css properties for the form tags:

form { display: inline; }

Example: http://jsbin.com/omene3/2/edit

like image 53
spinon Avatar answered Oct 05 '22 01:10

spinon