Yep. It’s me again!
I would axe the ‘please enter’ text as redundant to your labels. If they can’t figure it out from the label, they probably aren’t smart enough to be using the page in the first place.
As stated above, they are error messages.
My gut reaction is “You’re drawing a pretty picture before you have semantic markup of your content” – the road to failure. Markup FIRST before you get your heart set on styling that might not even be possible/practical.
A good reminder from Dr. Semantics!! (See why I rang?!)
Here is a snippet of my code. (Please spare comments on my use of a List for the Fields if you are a UL hater!)
<!-- CREATE ACCOUNT FORM -->
<form id="createAccount" action="" method="post">
<fieldset>
<legend>Create a Member Account</legend>
<ul>
<!-- Required Note -->
<li id="requiredNote">
<b>*</b> = Required Field
</li>
<!-- Email -->
<li>
<label for="email"><b>*</b>E-mail:</label>
<input id="email" name="email" type="text" maxlength="60"
value="<?php if(isset($email)){echo htmlspecialchars($email, ENT_QUOTES);} ?>" /><!-- Sticky Field -->
<?php
if (!empty($errors['email'])){
echo '<span class="error">' . $errors['email'] . '</span>';
}
?>
</li>
<!-- Password1 -->
<li>
<label for="pass1"><b>*</b>Password:</label>
<div id="restrictions">
Must Contain:
<ul>
<li>At least 1 Upper-Case Letter</li>
<li>At least 1 Lower-Case Letter</li>
<li>At least 1 Number</li>
<li>At least 1 Special Character</li>
<li>Between 8-15 Characters</li>
</ul>
</div>
<input id="pass1" name="pass1" type="password" maxlength="40" />
<?php
if (!empty($errors['pass'])){
echo '<span class="error">' . $errors['pass'] . '</span>';
}
?>
</li>
<!-- Password2 -->
<li>
<label for="pass2"><b>*</b>Confirm Password:</label>
<input id="pass2" name="pass2" type="password" maxlength="40" />
</li>
Here is a snippet of my styles…
#restrictions{
float: right;
padding: 0.5em 0.5em 0.5em 2em;
font-size: 0.8em;
line-height: 1.1em;
background-color: #FFC;
}
#restrictions ul{
padding: 0 0 0 1em;
}
#restrictions ul li{
padding: 0;
}
.error{
display: inline;
font-size: 0.8em;
font-weight: 500;
color: #F00;
}
#pass2{
clear: both;
}
And here is a screen-shot of my new Form…
No Errors
With Errors
I like how this looks, but I don’t like the huge white-space between the Password and Confirm Password fields. How can I make the Password Fields “hug” each other?
IF those ‘please’ texts are error messages, I’d move them up next to the labels instead of putting them next to the fields…
Why do you say that?
Is what I have that bad?
And if I followed your suggestion, could I place the Error Messages BENEATH the fields so that I don’t disrupt the Label/Field pairing?
(Personally I think Red Text Error-Messages off to the right side look best…)
and drop the ‘friendly’ speak as unprofessional and instead say “ERROR, REQUIRED FIELD!”
I’ll try to toughen up a little bit…
I’m with the folks saying ‘bad’ on the requirements – in fact one of your requirements makes it EASIER to crack, the short length… see the xkcd comic on the subject.. Passwords like that are a social engineering disaster as users will end up writing it down on a sticky pad on the monitor or under the keyboard because they can’t remember it. (or worse shove it into a password ‘manager’ tool)
What I am trying to do is better than letting people choose simple, 8-character passwords like “password”, “LetMeIn”, and so on.
I would be open to making the Minimum Password Length = 20 characters and force people to use “Pass-Phrases” instead…
But I’m the nut who allows 127 character passwords if the user wants to have it.
That isn’t a bad idea.
Security is still PEBKAC, but for the people who aren’t a problem, give them the tools to not be a problem… forcing case sensitive nonsense, numbers, special characters and then putting a absurdly short length on it? Doesn’t actually make it more secure.
Besides, 15 characters annoys me since my standard passwords are 18 to 32 characters in length.
As stated, I am not opposed to longer Passwords/Pass-Phrases. But I don’t think forcing people to go beyond all Lower-Case Dictionary Words is a bad idea at all…
Debbie