Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
03fcc196
Commit
03fcc196
authored
Jul 02, 2024
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add success page on form submit
parent
685ba1d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
173 additions
and
6 deletions
+173
-6
lamartinFrontend/index.html
lamartinFrontend/index.html
+4
-1
lamartinFrontend/main.js
lamartinFrontend/main.js
+16
-2
lamartinFrontend/style.css
lamartinFrontend/style.css
+25
-3
lamartinFrontend/success.html
lamartinFrontend/success.html
+128
-0
No files found.
lamartinFrontend/index.html
View file @
03fcc196
...
@@ -288,7 +288,10 @@
...
@@ -288,7 +288,10 @@
<!-- end of image section -->
<!-- end of image section -->
<div
class=
"form-btn"
>
<div
class=
"form-btn"
>
<button
type=
"submit"
class=
"btn btn-sumbit"
>
Submit
</button>
<button
type=
"submit"
class=
"btn btn-sumbit"
id=
"btn-sumbit"
>
<div
class=
"loader"
></div>
<div
class=
"btn-text"
>
Submit
</span>
</button>
</div>
</div>
</form>
</form>
</div>
</div>
...
...
lamartinFrontend/main.js
View file @
03fcc196
...
@@ -181,7 +181,11 @@ $(document).ready(function () {
...
@@ -181,7 +181,11 @@ $(document).ready(function () {
},
},
submitHandler
:
function
(
form
)
{
submitHandler
:
function
(
form
)
{
var
formData
=
new
FormData
(
form
);
var
formData
=
new
FormData
(
form
);
console
.
log
(
formData
.
get
(
'
candidateImage
'
));
let
jsonData
=
{};
$
(
'
.loader
'
).
css
(
'
display
'
,
'
inline-block
'
);
$
(
'
.btn-text
'
).
css
(
'
display
'
,
'
none
'
);
$
(
'
#btn-sumbit
'
).
prop
(
'
disabled
'
,
true
);
$
.
ajax
({
$
.
ajax
({
// TODO: move the url to a constant file
// TODO: move the url to a constant file
...
@@ -191,9 +195,19 @@ $(document).ready(function () {
...
@@ -191,9 +195,19 @@ $(document).ready(function () {
processData
:
false
,
processData
:
false
,
contentType
:
false
,
contentType
:
false
,
success
:
function
(
response
)
{
success
:
function
(
response
)
{
console
.
log
(
'
Success:
'
,
response
);
formData
.
forEach
((
value
,
key
)
=>
{
jsonData
[
key
]
=
value
;
});
sessionStorage
.
setItem
(
'
userData
'
,
JSON
.
stringify
(
jsonData
));
window
.
location
.
href
=
'
success.html
'
;
},
},
error
:
function
(
xhr
,
status
,
error
)
{
error
:
function
(
xhr
,
status
,
error
)
{
$
(
'
.loader
'
).
css
(
'
display
'
,
'
none
'
);
$
(
'
.btn-text
'
).
css
(
'
display
'
,
'
inline-block
'
);
$
(
'
#btn-sumbit
'
).
prop
(
'
disabled
'
,
false
);
if
(
xhr
.
responseText
)
{
if
(
xhr
.
responseText
)
{
var
errorMessage
=
JSON
.
parse
(
xhr
.
responseText
).
message
;
var
errorMessage
=
JSON
.
parse
(
xhr
.
responseText
).
message
;
console
.
error
(
'
Server Response:
'
,
errorMessage
);
console
.
error
(
'
Server Response:
'
,
errorMessage
);
...
...
lamartinFrontend/style.css
View file @
03fcc196
...
@@ -110,7 +110,9 @@ body {
...
@@ -110,7 +110,9 @@ body {
}
}
.btn
{
.btn
{
display
:
inline-block
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-weight
:
400
;
font-weight
:
400
;
text-align
:
center
;
text-align
:
center
;
white-space
:
nowrap
;
white-space
:
nowrap
;
...
@@ -142,7 +144,7 @@ body {
...
@@ -142,7 +144,7 @@ body {
border-color
:
#0062cc
;
border-color
:
#0062cc
;
}
}
.form-image-group
{
.form-image-group
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
...
@@ -150,7 +152,7 @@ body {
...
@@ -150,7 +152,7 @@ body {
margin-top
:
30px
;
margin-top
:
30px
;
}
}
.form-image-group
.form-group
{
.form-image-group
.form-group
{
display
:
flex
;
display
:
flex
;
justify-content
:
center
;
justify-content
:
center
;
align-items
:
center
;
align-items
:
center
;
...
@@ -165,4 +167,24 @@ body {
...
@@ -165,4 +167,24 @@ body {
/* border: 1px solid #ddd; */
/* border: 1px solid #ddd; */
margin
:
10px
;
margin
:
10px
;
object-fit
:
cover
;
object-fit
:
cover
;
}
.loader
{
display
:
none
;
border
:
5px
solid
#f3f3f3
;
border-top
:
5px
solid
#3498db
;
border-radius
:
50%
;
width
:
16px
;
height
:
16px
;
animation
:
spin
2s
linear
infinite
;
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
}
\ No newline at end of file
lamartinFrontend/success.html
0 → 100644
View file @
03fcc196
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
La Martiniere for Girls - Proof of Delivery
</title>
<style>
body
{
font-family
:
Arial
,
sans-serif
;
margin
:
0
;
padding
:
0
;
}
.container
{
max-width
:
800px
;
margin
:
50px
auto
;
padding
:
20px
;
border-radius
:
10px
;
}
.header
{
text-align
:
center
;
}
.header
h1
{
margin-bottom
:
5px
;
}
.proof-of-delivery
{
text-align
:
center
;
margin
:
20px
0
;
padding
:
10px
;
background-color
:
#d9edf7
;
color
:
#31708f
;
border
:
1px
solid
#bce8f1
;
border-radius
:
5px
;
}
.email
{
color
:
green
;
}
.details
{
margin
:
20px
0
;
}
.details
p
{
margin
:
5px
0
;
}
.details
span
{
font-weight
:
bold
;
}
.footer
{
margin
:
20px
0
;
text-align
:
center
;
font-size
:
12px
;
color
:
#555
;
}
.social-links
{
text-align
:
center
;
margin
:
20px
0
;
}
.social-links
a
{
margin
:
0
10px
;
text-decoration
:
none
;
color
:
#007bff
;
}
.social-links
a
:hover
{
text-decoration
:
underline
;
}
</style>
<script
src=
"https://code.jquery.com/jquery-3.6.0.min.js"
></script>
</head>
<body>
<div
class=
"container"
>
<div
class=
"header"
>
<img
src=
"https://i0.wp.com/lamartiniere.co/wp-content/uploads/2020/10/cropped-lmbb-logo-site-logo.png?w=240&ssl=1"
alt=
"Proof of Delivery"
height=
"80px"
>
<h2
id=
"school"
></h2>
</div>
<div
class=
"proof-of-delivery"
>
<p>
Thank you. Your application has been received.
</p>
</div>
<div
class=
"details"
id=
"details"
></div>
<div
class=
"footer"
>
<p>
Please quote the reference
<span
class=
"email"
>
piklughosh01@gmail.com
</span>
for further correspondence
until such time the admission procedure is under way.
</p>
</div>
</div>
<script>
$
(
document
).
ready
(
function
()
{
// Retrieve the JSON string from session storage
var
jsonData
=
sessionStorage
.
getItem
(
'
userData
'
);
// Parse the JSON string back to an object
if
(
jsonData
)
{
var
userObject
=
JSON
.
parse
(
jsonData
);
// Display the data
var
userDataHtml
=
`
<p><span>CATEGORY:</span>
${
userObject
.
category
}
</p>
<p><span>CLASS:</span>
${
userObject
.
admissionClass
}
</p>
<p><span>NAME OF CANDIDATE:</span>
${
userObject
.
fullName
}
</p>
<p><span>DATE OF BIRTH:</span>
${
userObject
.
dateOfBirth
}
</p>
<p><span>FATHER'S NAME:</span>
${
userObject
.
fatherName
}
</p>
<p><span>FATHER'S NAME:</span>
${
userObject
.
motherName
}
</p>
`
;
$
(
'
#details
'
).
html
(
userDataHtml
);
$
(
'
#school
'
).
html
(
userObject
.
school
);
}
else
{
$
(
'
#details
'
).
html
(
'
<p>No user data found.</p>
'
);
}
});
</script>
</body>
</html>
\ No newline at end of file
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