Add validateEmail to forms
This commit is contained in:
parent
1c4a84dee6
commit
bd20536046
1 changed files with 3 additions and 0 deletions
|
@ -99,3 +99,6 @@ module.exports.updateSelects = (el) ->
|
||||||
value = $(select).attr('value')
|
value = $(select).attr('value')
|
||||||
$(select).val(value)
|
$(select).val(value)
|
||||||
|
|
||||||
|
module.exports.validateEmail = (email) ->
|
||||||
|
filter = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i # https://news.ycombinator.com/item?id=5763990
|
||||||
|
return filter.test(email)
|
||||||
|
|
Reference in a new issue