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) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -