I am trying to display two form submit buttons on the same line inside a table. In IE7, the following code works fine, but in IE8 the Delete button drops to the next line, although I declared the form to display inline. Any suggestions?
I created a basic test page to show the problem: http://ajondeck.net/test/displayinline.html
Your example does not work primarily because your HTML is not valid. Do you open td, add Submit1 and close the form element? Correct this, and many problems are likely to disappear.
, .
, , .
//Put this in ur css styling area .spanFormat { text-align: left; display: table-cell; min-width: 10px; padding-right: 10px; } //This is the html that is used to make ur input buttons side by side on two //different forms. <span class="spanFormat"> <form action="someaction.php" method="post"> <input type="submit" name="action1" value="somevalue" /> <input type="hidden" name="param" value="somevalue" /> </form> </span> <span class="spanFormat"> <form action="someaction2.php" method="post"> <input type="submit" name="action3" value="somevalue" /> <input type="hidden" name="param1" value="somevalue" /> </form> </span>
, , - CSS ( , ) , :
<form method="post" action="nextPage.html" name="nameForm" style="display:inline;"> <input type="hidden" name="value" value="someValue"> <input type="submit" name="submit" value="Submit"> </form>
TD.
:
<table cellpadding="0" cellspacing="0"> <tr><td> <form action="action.php" method="post" style="padding: 0; margin: 0"> <input type="submit" value="Submit" name="X1"> </form> </td><td> <form action="action.php" method="post" style="padding: 0; margin: 0"> <input type="submit" value="Submit" name="X2"> </form> </td></tr></table>
.
. , , . (.. Action.php ) - :
if ($_POST['X2'] == 'Submit'){ //do stuff }
( ) , , , , .
, td css.
<td style="width:300px"> <input id="Submit1" type="submit" value="Submit" name="Submit1"/> <form id="form2" action="www.test.com/test2" method="post" name="form2"> <input id="Delete" type="submit" value="Delete" name="Delete"/> </form>
, - . divs css, - !
, : http://www.cssdrive.com/index.php/examples/exampleitem/tableless_forms/P30/
. , "-" - 3l33t1st snobs.;-) . . . .
divs . ie, ff, opera, safari .. , , css (, "padding" "margin" ).
[input type = submit] . , "type =" , . , script javascript, !; -)
, , - ( ), FORM (.. style = "margin: 0px; float: right;" ) ...