[Web] Complain about non-email email fields
This commit is contained in:
@@ -99,6 +99,15 @@ $(document).ready(function() {
|
||||
$(this).removeClass('inputMissingAttr');
|
||||
}
|
||||
}
|
||||
if ($(this).attr("type") == 'email') {
|
||||
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
|
||||
if (!emailReg.test($(this).val())) {
|
||||
invalid = true;
|
||||
$(this).addClass('inputMissingAttr');
|
||||
} else {
|
||||
$(this).removeClass('inputMissingAttr');
|
||||
}
|
||||
}
|
||||
if ($(this).attr("max")) {
|
||||
if (Number($(this).val()) > Number($(this).attr("max"))) {
|
||||
invalid = true;
|
||||
@@ -191,6 +200,15 @@ $(document).ready(function() {
|
||||
$(this).removeClass('inputMissingAttr');
|
||||
}
|
||||
}
|
||||
if ($(this).attr("type") == 'email') {
|
||||
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
|
||||
if (!emailReg.test($(this).val())) {
|
||||
invalid = true;
|
||||
$(this).addClass('inputMissingAttr');
|
||||
} else {
|
||||
$(this).removeClass('inputMissingAttr');
|
||||
}
|
||||
}
|
||||
if ($(this).attr("max")) {
|
||||
if (Number($(this).val()) > Number($(this).attr("max"))) {
|
||||
invalid = true;
|
||||
|
Reference in New Issue
Block a user