Line up submit buttons?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
crzyman
Forum Newbie
Posts: 18
Joined: Fri Sep 16, 2005 10:44 pm

Line up submit buttons?

Post 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
:?:
mickd
Forum Contributor
Posts: 397
Joined: Tue Jun 21, 2005 9:05 am
Location: Australia

Post 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'] . '"'; } ?>
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post 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.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post 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>
User avatar
ambivalent
Forum Contributor
Posts: 173
Joined: Thu Apr 14, 2005 8:58 pm
Location: Toronto, ON

Post 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.
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

forms have always had margins.
Post Reply