Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team6-Digital Insight for Health
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chen Liang
Team6-Digital Insight for Health
Commits
81f9d6f5
Commit
81f9d6f5
authored
4 months ago
by
Yulong Wang
Browse files
Options
Downloads
Patches
Plain Diff
Delete emailValidation.js
parent
3dfa745c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/resources/static/js/emailValidation.js
+0
-69
0 additions, 69 deletions
src/main/resources/static/js/emailValidation.js
with
0 additions
and
69 deletions
src/main/resources/static/js/emailValidation.js
deleted
100644 → 0
+
0
−
69
View file @
3dfa745c
$
(
document
).
ready
(
function
()
{
const
emailPattern
=
/^
[^\s
@
]
+@
[^\s
@
]
+
\.[^\s
@
]
+$/
;
// 简单 Email 正则
//Listen for input events using jQuery's on method
$
(
'
#email
'
).
on
(
'
input
'
,
function
()
{
const
emailValue
=
$
(
this
).
val
();
const
$emailError
=
$
(
'
#emailError
'
);
// Check whether the input is empty or does not match the regular expression
if
(
!
emailPattern
.
test
(
emailValue
)
&&
emailValue
!==
''
)
{
$emailError
.
text
(
"
Please enter a valid email address.
"
);
$emailError
.
show
();
// Display error message
}
else
{
$emailError
.
text
(
""
);
$emailError
.
hide
();
// Hide error message
}
});
$
(
'
#name
'
).
on
(
'
mouseleave
'
,
function
()
{
const
value
=
$
(
this
).
val
();
const
$nameError
=
$
(
'
#nameError
'
);
if
(
value
==
''
)
{
$nameError
.
text
(
"
Please enter data.
"
);
$nameError
.
show
();
}
else
{
$nameError
.
text
(
""
);
$nameError
.
hide
();
}
});
$
(
'
#password
'
).
on
(
'
mouseleave
'
,
function
()
{
const
value
=
$
(
this
).
val
();
const
$passwordError
=
$
(
'
#passwordError
'
);
if
(
value
==
''
)
{
$passwordError
.
text
(
"
Please enter data.
"
);
$passwordError
.
show
();
}
else
{
$passwordError
.
text
(
""
);
$passwordError
.
hide
();
}
});
$
(
'
#phone
'
).
on
(
'
mouseleave
'
,
function
()
{
const
value
=
$
(
this
).
val
();
const
$phoneError
=
$
(
'
#phoneError
'
);
// 检查输入是否为空或不符合正则表达式
if
(
value
==
''
)
{
$phoneError
.
text
(
"
Please enter data.
"
);
$phoneError
.
show
();
}
else
{
$phoneError
.
text
(
""
);
$phoneError
.
hide
();
}
});
$
(
'
#address
'
).
on
(
'
mouseleave
'
,
function
()
{
const
value
=
$
(
this
).
val
();
const
$addressError
=
$
(
'
#addressError
'
);
if
(
value
==
''
)
{
$addressError
.
text
(
"
Please enter data.
"
);
$addressError
.
show
();
}
else
{
$addressError
.
text
(
""
);
$addressError
.
hide
();
}
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment