javascript - Remove invalid characters from email -


i want users mistakenly entering invalid characters in email input (pre server-side validation/cleanup)

note: not validating emails in frontend, cleaning up

// coffeescript $(element).find('input[type="email"]').on 'change keyup', (event) ->     = $(this)     v = i.val()     i.val(v.replace( [what goes here?] , '')) 

i want remove space , illegal characters.

what's regex pattern?

something like. saying, strip things not want. honest, not know acceptable email chars.

.replace(/[^a-za-z0-9_-@.]/g,'') 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -