Fix email

This commit is contained in:
tahmidshahriar 2015-06-30 09:35:45 -07:00
parent 4d8c539b2c
commit 56b81f175e
2 changed files with 11 additions and 1 deletions

View file

@ -27,7 +27,7 @@
form.form form.form
.form-group .form-group
label.control-label(for="email") label.control-label(for="email")
span(data-i18n="general.email") Email span() Email #{temp}
| : | :
.input-border .input-border
input#email.input-large.form-control(name="email", type="email", value=formValues.email) input#email.input-large.form-control(name="email", type="email", value=formValues.email)

View file

@ -76,7 +76,17 @@ module.exports = class AuthModal extends ModalView
@enableModalInProgress(@$el) # TODO: part of forms @enableModalInProgress(@$el) # TODO: part of forms
loginUser userObject, null, window.nextURL 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: -> createAccount: ->
unless emailCheck() is true
return
forms.clearFormAlerts(@$el) forms.clearFormAlerts(@$el)
userObject = forms.formToObject @$el userObject = forms.formToObject @$el
delete userObject.subscribe delete userObject.subscribe