Page 1 of 1

Line up submit buttons?

Posted: Fri Sep 30, 2005 5:14 pm
by crzyman
Everything works, but the submit buttons won't line up. Please help.

Code: Select all

<br><br>
<table align="center">
<tr>
<td>
<form action="register.php" method="post">

<b>Artist/Bandname:&nbsp;&nbsp;</b> <input type="text" size="20" maxlength="20" name="bandname" 
<?php if (isset($_POST['bandname'])) { ?> value="<?php echo $_POST['bandname']; ?>" <?php } ?>/><br />

<b>Username:</b> <input type="text" size="20" maxlength="20" name="username" 
<?php if (isset($_POST['username'])) { ?> value="<?php echo $_POST['username']; ?>" <?php } ?>/><br />

<b>Password:&nbsp;</b> <input type="password" size="20" maxlength="10" name="password" /><br />

<b>Confirm Password:</b> <input type="password" size="20" maxlength="10" name="confirmpass" /><br />

<br>
<table align="center">
<tr>
<td> 
<P align = "left">
<input type="submit" name="submit" value="Register!" />  
</form>
</P>
</td>
<td>
<FORM METHOD="POST" ACTION="/login_form.inc.php"> 
<P align = "center">
<input type="Submit" name="Submit" value="Login">
</P>
 </form>
</td>
</tr>
</table>

                                
</td>

</table
:?:

Posted: Fri Sep 30, 2005 10:06 pm
by mickd
didnt really get some stuff like you have a form by itself with only a login submit button but i just rewrote it using a different basic stucture, might want to modify the actual forms abit.

save it as a html documen and open it in explorer to see the basic shape.

Code: Select all

<table align="left"><form action="register.php" method="post"> 
<tr>
<td> 
<b>Artist/Bandname:&nbsp;&nbsp;</b> 
</td>
<td><input type="text" size="20" maxlength="20" name="bandname"
<?php if (isset($_POST['bandname'])) { ?> value="<?php echo $_POST['bandname']; ?>" <?php } ?>/><br />
</td>
</tr>
<tr>
<td>
<b>Username:</b>
</td>
<td>
 <input type="text" size="20" maxlength="20" name="username" 
<?php if (isset($_POST['username'])) { ?> value="<?php echo $_POST['username']; ?>" <?php } ?>/><br /> 
</td>
</tr>
<tr>
<td>
<b>Password:&nbsp;</b>
</td>
<td>
 <input type="password" size="20" maxlength="10" name="password" /><br /> 
</td>
</tr>
<tr>
<td>
<b>Confirm Password:</b>
</td>
<td>
 <input type="password" size="20" maxlength="10" name="confirmpass" /><br /> 
</td>
</tr>
<tr>
<td>  
<input type="submit" name="submit" value="Register!" /></form>
</td>
<td><FORM METHOD="POST" ACTION="/login_form.inc.php">
<input type="Submit" name="Submit" value="Login"> 
</td>
</tr>
</table></form>
btw for the php why dont you just do:

Code: Select all

<?php if(isset($_POST['username'])) { echo 'value="' . $_POST['username'] . '"'; } ?>

Posted: Sat Oct 01, 2005 5:26 am
by pilau
I have NO idea why, or how - but it's the "<FORM METHOD="POST" ACTION="/login_form.inc.php">" line that is making this hell of a weird thingy occur.

Posted: Sat Oct 01, 2005 7:56 am
by foobar
pilau wrote:I have NO idea why, or how - but it's the "<FORM METHOD="POST" ACTION="/login_form.inc.php">" line that is making this hell of a weird thingy occur.
Try setting the form margins and padding to 0:

Code: Select all

<style type="text/css">
form { margin: 0px; padding: 0px; }
</style>

Posted: Sat Oct 01, 2005 2:35 pm
by ambivalent

Code: Select all

<style type="text/css">
form { margin: 0px; padding: 0px; }
</style>
Excellent. I was having an issue where two submit buttons in a table insisted on staying at the tops of the cells, despite all my efforts to the contrary...the above was the solution, TY.

Posted: Sun Oct 02, 2005 8:18 am
by pilau
foobar wrote:Try setting the form margins and padding to 0:

Code: Select all

<style type="text/css">
form { margin: 0px; padding: 0px; }
</style>
Woah woah - since when do forms have margins?
Anyway, I tried it on my system and it worked. So here's a solution for you crzyman

Posted: Sun Oct 02, 2005 8:20 am
by feyd
forms have always had margins.