Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
Basic_Registration_form
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thi Thanh Yen Hoang
Basic_Registration_form
Commits
2c2c3b05
Commit
2c2c3b05
authored
Jun 24, 2016
by
Thi Thanh Yen Hoang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update third commit
parent
1f2c9964
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
62 deletions
+37
-62
Untitled Folder
+1
-0
bt.html
+8
-13
javascript.js
+10
-16
stylesheet.css
+18
-33
No files found.
Untitled Folder
@
596cee67
Subproject commit 596cee675ee1c18e25584f74c8c64c046fa841a1
bt.html
View file @
2c2c3b05
...
...
@@ -5,9 +5,6 @@
<title>
Result
</title>
</head>
<body>
<table>
<tr><td>
<form>
<table>
<p>
Register Form
</p>
...
...
@@ -16,24 +13,24 @@
<td><div
id=
"message"
>
</div></td>
</tr>
<tr>
<td
class=
label
>
First Name
</td>
<td><input
type=
"text"
id=
"fname"
placeholder=
"First Name"
value=
""
size=
80%
/>
</td>
<td
class=
label
><label
for=
"email"
>
First Name
</label>
</td>
<td><input
type=
"text"
id=
"fname"
placeholder=
"First Name"
value=
""
size=
90%
required=
"true"
/>
</td>
</tr>
<tr>
<td
class=
label
>
Last Name
</td>
<td><input
type=
"text"
placeholder=
"Last Name"
id=
"lname"
value=
""
size=
8
0%
/>
</td>
<td><input
type=
"text"
placeholder=
"Last Name"
id=
"lname"
value=
""
size=
9
0%
/>
</td>
</tr>
<tr>
<td
class=
label
>
Email
</td>
<td><input
type=
"text"
placeholder=
"Email"
id=
"email"
value=
""
size=
8
0%
/>
</td>
<td><input
type=
"text"
placeholder=
"Email"
id=
"email"
value=
""
size=
9
0%
/>
</td>
</tr>
<tr>
<td
class=
label
>
Email Confirmation
</td>
<td><input
type=
"text"
placeholder=
"Email Confirmation"
id=
"cemail"
value=
""
size=
8
0%
/>
</td>
<td><input
type=
"text"
placeholder=
"Email Confirmation"
id=
"cemail"
value=
""
size=
9
0%
/>
</td>
</tr>
<tr>
<td
class=
label
>
Birthday
</td>
<td>
<input
type=
"text"
placeholder=
"Birthday"
id=
"bday"
value=
""
size=
8
0%
/></td>
<td>
<input
type=
"text"
placeholder=
"Birthday"
id=
"bday"
value=
""
size=
9
0%
/></td>
</tr>
<tr>
<td
class=
label
>
</td>
...
...
@@ -41,9 +38,7 @@
</tr>
</table>
</form>
</td><tr></table>
<script
src=
"javascript.js"
></script>
<script
src=
"javascript.js"
>
</script>
</body>
</html>
javascript.js
View file @
2c2c3b05
function
validate
()
{
function
validate
()
{
//input
var
check
=
true
;
var
firstname
=
document
.
getElementById
(
"fname"
).
value
;
var
lastname
=
document
.
getElementById
(
"lname"
).
value
;
var
email
=
document
.
getElementById
(
"email"
).
value
;
var
cemail
=
document
.
getElementById
(
"cemail"
).
value
;
var
bday
=
document
.
getElementById
(
"bday"
).
value
;
var
alphabeta
=
/
[
a-zA-Z
]
+$/
;
var
date
=
/^
((((
0
[
13578
])
|
(
1
[
02
]))[\/]?(([
0-2
][
0-9
])
|
(
3
[
01
])))
|
(((
0
[
469
])
|
(
11
))[\/]?(([
0-2
][
0-9
])
|
(
30
)))
|
(
02
[\/]?[
0-2
][
0-9
]))[\/]?\d{4}
$/
;
var
filter
=
/^
([
a-zA-Z0-9_
\.\-])
+
\@(([
a-zA-Z0-9
\-])
+
\.)
+
([
a-zA-Z0-9
]{2,4})
+$/
;
//message
var
message
=
document
.
getElementById
(
"message"
);
// Validate
if
(
firstname
==
""
||
lastname
==
""
||
email
==
""
||
cemail
==
""
|
bday
==
""
)
{
if
(
firstname
==
""
||
lastname
==
""
||
email
==
""
||
cemail
==
""
||
bday
==
""
)
{
message
.
innerHTML
=
"Input Error"
;
message
.
style
.
color
=
"red"
;
return
false
;
check
=
false
;
}
else
{
if
(
email
==
cemail
)
{
else
{
if
(
email
==
cemail
)
{
if
(
alphabeta
.
test
(
firstname
)
==
true
&&
alphabeta
.
test
(
lastname
)
==
true
&&
date
.
test
(
bday
)
==
true
&&
filter
.
test
(
email
)
==
true
&&
filter
.
test
(
cemail
)
==
true
)
{
alert
(
"Thank for your registering"
);
return
true
;
check
=
true
;
}
else
{
message
.
innerHTML
=
"Input Error"
;
message
.
style
.
color
=
"red"
;
return
false
;
check
=
false
;
}
}
else
{
message
.
innerHTML
=
"Input Error"
;
message
.
style
.
color
=
"red"
;
return
false
;
check
=
false
;
}
}
return
check
;
}
stylesheet.css
View file @
2c2c3b05
form
{
margin
:
auto
;
border
:
none
;
margin-top
:
20px
;
margin-left
:
420px
;
margin-right
:
400px
;
padding-bottom
:
10px
;
border
:
1px
solid
black
;
}
input
{
border-radius
:
5px
;
float
:
right
;
margin-top
:
5px
;
margin-right
:
10px
;
margin-bottom
:
5px
;
margin-left
:
25px
;
padding-left
:
5px
;
padding-right
:
5px
;
padding-bottom
:
5px
;
padding-top
:
5px
;
margin
:
5px
5px
5px
25px
;
padding
:
5px
;
}
button
{
margin-top
:
5px
;
margin-right
:
10px
;
margin-bottom
:
5px
;
margin-left
:
25px
;
margin
:
5px
10px
5px
25px
;
background-color
:
white
;
border-radius
:
5px
;
}
p
{
p
{
border
:
none
;
text-align
:
center
;
font-size
:
24px
;
}
td
.label
{
td
.label
{
text-align
:
right
;
margin-top
:
10px
;
margin-right
:
5px
;
margin-bottom
:
10px
;
margin-right
:
5px
;
margin-bottom
:
10px
;
font-weight
:
bold
;
font-size
:
14px
;
}
table
{
border
:
1px
ridge
gray
;
margin-left
:
20%
;
margin-right
:
20%
;
}
table
table
{
border
:
none
;
margin-left
:
0
;
margin-right
:
0
;
margin-left
:
auto
;
margin-right
:
auto
;
}
#message
{
#message
{
float
:
right
;
width
:
95
%
;
margin-right
:
1
5px
;
width
:
96
%
;
margin-right
:
5px
;
color
:
#000000
;
background-color
:
#F08080
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment