Changed event to focusout
This commit is contained in:
parent
4b6c93c127
commit
c92ce615be
|
@ -5,7 +5,7 @@
|
|||
= render 'form'
|
||||
|
||||
:javascript
|
||||
$('#key_key').on('keyup', function(){
|
||||
$('#key_key').on('focusout', function(){
|
||||
var title = $('#key_title'),
|
||||
val = $('#key_key').val(),
|
||||
key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi);
|
||||
|
@ -13,4 +13,4 @@
|
|||
if( key_mail && key_mail.length > 0 && title.val() == '' ){
|
||||
$('#key_title').val( key_mail );
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue