Forms and browsers

Wratox1

Member
Reaction score
22
Hello, im trying to create the loginpage for my site, but i have a cross-browser problem..

here is a rough picture on how i have now in google chrome:
form.jpg

in internet explorer:
form2.jpg

and in firefox:
form3.jpg


in the pictures the username, password and remember are in the same form as the login-button, the register- and cancel-buttons are two completely separate forms.

if you look close(on chrome and firefox) you can see that the buttons are not centered, and i them to, if i put a center-tag around the buttons they all look like internet explorerexcept that theyre centered..

and this is my code:

Code:
<div id="loginbox">
<form name="login" action="action" method="POST" class="form">

<label for="username">Username:</label>
<input type="text" name="username" id="username" class="input" />

<label for="password">Password:</label>
<input type="password" name="password" id="password" class="input" />

<label for="remember">Remember me?</label> <input type="checkbox" name="remember" id="remember" value="yes"/>

<input type="submit" name="login" value="Log in" class="loginsubmit" />
</form>

<form name="register" action="/register" method="POST" class="form">
<input type="submit" name="register" value="Register" class="loginsubmit" />
</form>

<form name="cancel" action="<?php echo $_SESSION['lastpage']; ?>" method="POST" class="form">
<input type="submit" name="cancel" value="Cancel" class="loginsubmit" />
</form>
</div>

here is the css code:

Code:
#loginbox
{
position:relative;
padding:4px;
width:25%;
margin-right:auto;
margin-left:auto;
margin-top:10%;
border: 5px solid #6698FF;
}

#loginbox .form
{
padding:0;
margin:0;
}

.input
{
color:#6698FF; 
font-size:100%; 
font-family: 'Orbitron';
}

.loginsubmit
{
background-color: #6698FF;
color: #000000;
border: 1px solid #6698FF;
font-family: 'Orbitron';
font-size:100%;
margin-top:10px;
}

anyone have a clue on how i could center the buttons and make it look the same in all browsers without using different pages for each browser or checking which browser the user have?
 

Wratox1

Member
Reaction score
22
Is it me or you don't even have tr and td in your table?

i dont need tr and td's in the table, actually i dont need the table at all, but the table prevents chrome and firefox from displaying it as the same as internet explorer..

Is it just me, or is he using a table? o_o

i am using a table.

Is it just me, or are tables so 2001.

how does that help?

Problem here is you don't know how to HTML.

http://w3schools.com/html/default.asp

i can only think of one thing when you stated this, and i looked at my code(that i posted here), and saw that i had forgotten to the start-tag for the div..

i will fix this now.

if this is not what you are talking about then maybe you could tell me how to fix my problem?
 

Wratox1

Member
Reaction score
22
i dont need the table really and i have deleted it now, but i need to have the three buttons centered and they must be centered in atleast google chrome, internet explorer and firefox.

none of you havent tried to fix the problem(from what i can tell), you have only complained about the table i had..
 

Wratox1

Member
Reaction score
22
Code:
<?php
if(!isset($_SESSION)){
session_start();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href='http://fonts.googleapis.com/css?family=Orbitron:regular,500' rel='stylesheet' type='text/css'>
<link href="main.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Snoman.se/login</title>



</head>
<body>
<div id="logo">
<a href="http://www.henriksnoman.kaggteknik.se/">Snoman.se</a>
</div>
<?php
if($_COOKIE['user'] == ""){


?>
<div id="loginbox">
<table>
<form name="login" action="action" method="POST" class="form">

<label for="username">Username:</label>
<input type="text" name="username" id="username" class="input" /><br>

<label for="password">Password:</label>
<input type="password" name="password" id="password" class="input" /><br>

<label for="remember">Remember me?</label> <input type="checkbox" name="remember" id="remember" value="yes"/><br>

<input type="submit" name="login" value="Log in" class="loginsubmit" />
</form>

<form name="register" action="/register" method="POST" class="form">
<input type="submit" name="register" value="Register" class="loginsubmit" />
</form>

<form name="cancel" action="<?php echo $_SESSION['lastpage']; ?>" method="POST" class="form">
<input type="submit" name="cancel" value="Cancel" class="loginsubmit" />
</form>
</table>
</div>
<?php
}
else{
?>
<div id="logout">
You are already logged in, you can log out if you want:<br>
<form name="logout" action="logout" method="POST">
<input type="submit" value="Log out" class="loginsubmit" />
</form>
</div>
<?php
}
?>
</body>
</html>

i think the problem is that the forms is pushing the next form down to the next row, but im not sure..
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Forms are block elements, so they appear below each other.
You should read up on CSS (inline vs block).
 

JerseyFoo

1/g = g-1
Reaction score
40
PHP:
<form id="loginbox" name="login" action="action" method="POST" class="form">
	<fieldset>
		<legend>Login</legend>
		<label for="username">Username:</label>
		<input type="text" name="username" id="username" class="input" />

		<label for="password">Password:</label>
		<input type="password" name="password" id="password" class="input" />

		<label for="remember">Remember me?</label>
		&nbsp;<input type="checkbox" name="remember" id="remember" value="yes"/>

		<input type="submit" name="login" value="login" class="loginsubmit" />
		<input type="submit" name="register" value="register" class="loginsubmit" />
		<input type="submit" name="cancel" value="cancel" class="loginsubmit" />
    </fieldset>
</form>

Should learn HTML though.
 

Wratox1

Member
Reaction score
22
Forms are block elements, so they appear below each other.
You should read up on CSS (inline vs block).

that i didnt know, thanks for telling me!

PHP:
<form id="loginbox" name="login" action="action" method="POST" class="form">
	<fieldset>
		<legend>Login</legend>
		<label for="username">Username:</label>
		<input type="text" name="username" id="username" class="input" />

		<label for="password">Password:</label>
		<input type="password" name="password" id="password" class="input" />

		<label for="remember">Remember me?</label>
		&nbsp;<input type="checkbox" name="remember" id="remember" value="yes"/>

		<input type="submit" name="login" value="login" class="loginsubmit" />
		<input type="submit" name="register" value="register" class="loginsubmit" />
		<input type="submit" name="cancel" value="cancel" class="loginsubmit" />
    </fieldset>
</form>

Should learn HTML though.

if you can read you will see that the buttons register and cancel are 2 completely different forms from the login button and your solution dont work..
 

UndeadDragon

Super Moderator
Reaction score
447
You can use CSS to fix the inline vs block. Use:

display: inline;
 

JerseyFoo

1/g = g-1
Reaction score
40
if you can read you will see that the buttons register and cancel are 2 completely different forms from the login button and your solution dont work..
If you can use logic you will see that having a seperate form for register and cancel in this context is retarded and you should either handle it on the PHP side by using the value of the submit field (like you should with register anyway), or just use links.

I would use JavaScript but something tells me you're one of those NoScripters.
 

Wratox1

Member
Reaction score
22
You can use CSS to fix the inline vs block. Use:

display: inline;

thanks! it worked! +rep!´

If you can use logic you will see that having a seperate form for register and cancel in this context is retarded and you should either handle it on the PHP side by using the value of the submit field (like you should with register anyway), or just use links.

I would use JavaScript but something tells me you're one of those NoScripters.

i dont like to argue, so im going to, and since the problem now is solved you dont need to bother..
Edit: the register-button redirects the user to the register page, and the cancel redirects the user to the page he was on when he clicked the login-button(which takes him to this login page)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top