Skip to content

Commit 6c1dfc2

Browse files
author
Shankar T
committed
- Eliminating non-generic methods.
1 parent d43fb75 commit 6c1dfc2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/demo/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121

2222
<div class="row">
2323
<label for="name">Address1</label>
24-
<input type="text" required class="form-control" pattern="[a-z]" id="l_address" name="l_address"
24+
<input type="text" required class="form-control" pattern="[a-z./]" id="l_address" name="l_address"
25+
data-message="Yah, Address1 should not be empty."
2526
placeholder="Enter address1">
2627

2728
</div>
@@ -50,7 +51,7 @@
5051

5152
<div class="row">
5253
<label for="name">Phone No 2 </label>
53-
<input type="text" class="form-control" pattern="[0-9.]" id="contact_no2" name="contact_no2"
54+
<input type="text" class="form-control" pattern="[0-9.]" required id="contact_no2" name="contact_no2"
5455
placeholder="Enter Phone No">
5556
</div>
5657

src/js/formValidator.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,16 @@ function jsRuleSets() {
715715
// To Validate Email.
716716
// Convert to Native String Format.
717717
email = email.toString();
718+
719+
// If no email or empty,
720+
if (!email) status = false;
721+
718722
// To Check it as String or Not.
719723
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)) {
720724
// Valid Email.
721725
status = true;
722726
}
723-
if (!email) status = false;
727+
724728
return status;
725729
};
726730
/*
@@ -866,7 +870,7 @@ var jsLogger = {
866870
*/
867871
table: function (data) {
868872
if (true !== this.status()) return false;
869-
console.table(data);
873+
console.log(data);
870874
}
871875
};
872876
/**

0 commit comments

Comments
 (0)