mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Fix email
This commit is contained in:
parent
4d8c539b2c
commit
56b81f175e
2 changed files with 11 additions and 1 deletions
|
@ -27,7 +27,7 @@
|
|||
form.form
|
||||
.form-group
|
||||
label.control-label(for="email")
|
||||
span(data-i18n="general.email") Email
|
||||
span() Email #{temp}
|
||||
| :
|
||||
.input-border
|
||||
input#email.input-large.form-control(name="email", type="email", value=formValues.email)
|
||||
|
|
|
@ -76,7 +76,17 @@ module.exports = class AuthModal extends ModalView
|
|||
@enableModalInProgress(@$el) # TODO: part of forms
|
||||
loginUser userObject, null, window.nextURL
|
||||
|
||||
emailCheck = ->
|
||||
email = $('#email', @$el).val()
|
||||
filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/
|
||||
unless filter.test(email)
|
||||
forms.setErrorToProperty @$el, 'email', "Please enter a valid email address", true
|
||||
return false
|
||||
return true
|
||||
|
||||
createAccount: ->
|
||||
unless emailCheck() is true
|
||||
return
|
||||
forms.clearFormAlerts(@$el)
|
||||
userObject = forms.formToObject @$el
|
||||
delete userObject.subscribe
|
||||
|
|
Loading…
Reference in a new issue