* {
margin
:
0
;
padding
}
.a {
color
#F00
#form
#login, #password, #passwordConfirm {
height
20px
border
1px
solid
#808080
padding-left
5px
border-radius:
3px
margin-left
legend {
#9900CC
font-size
18px
.button {
25px
width
100px
float
left
position
relative
top
50%
margin-top
-5px
-50px
{
250px
500px
absolute
-136px
-261px
#666600
10px
background-color
#C0C0D0
function
funCheck() {
var
login = document.getElementById(
'login'
);
password = document.getElementById(
'password'
passwordConfirm = document.getElementById(
'passwordConfirm'
// если поле логина пустое
if
(login.value ==
''
) {
val = document.getElementById(
'label0'
val.innerHTML =
'<span class="a">Please enter your login</span>'
login.style.border =
'1px solid #F00'
login.focus();
return
false
else
'Login'
'1px solid #808080'
// если поле пароля пустое
(password.value ==
passwordConfirm.value =
'label1'
'<span class="a">Please enter your password</span>'
password.style.border =
password.focus();
// если поле пароля меньше 6 символов
(password.value.length < 6) {
//password.value = '';
'<span class="a">Password must be have 6 or more symbols</span>'
'Password'
// если поле подтверждения пароля пустое
(passwordConfirm.value ==
'label2'
'<span class="a">Please enter confirm password</span>'
passwordConfirm.style.border =
passwordConfirm.focus();
// если значение пароля не совпадает со значением подтверждения пароля
(password.value != passwordConfirm.value) {
passwordConfirm.value ==
'<span class="a">Wrong</span>'
'Confirm'
funBlurLogin() {
funFocusPassword() {
funBlurPassword() {
funBlurPasswordConfirm() {
window.onload =
() {
myForm = document.getElementById(
'form0'
myForm.onsubmit = funCheck;
myLogin = document.getElementById(
myPassword = document.getElementById(
myPassword.onfocus = funFocusPassword;
myPassword.onblur = funBlurPassword;
myPasswordConfirm = document.getElementById(
myPasswordConfirm.onblur = funBlurPasswordConfirm;
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
script
src
"js/script.js"
></
</
body
form
id
"form0"
name
action
"#"
method
"post"
fieldset
legend
align
"left"
>Sign up</
input
"login"
type
"text"
value
""
autofocus
"autofocus"
label
"label0"
>Login</
br
"password"
"label1"
>Password</
"passwordConfirm"
"label2"
>Confirm</
>Register oneself</
class
"button"
"submit0"
"submit"
"perform"
"OK"