You can also trigger your function with
$(document).ready(function(){
$('.replace').focusout(function(){
str = $(this).val();
var dizi = { "İ": "i" };
str = str.replace(/(([İı]))+/g, function(harf){ return dizi[harf];});
$(this).val(str);
}).keyup(function() {
str = $(this).val();
var dizi = { "İ": "i" };
str = str.replace(/(([İı]))+/g, function(harf){ return dizi[harf];});
$(this).val(str);
});
});
UPDATE:
$(document).ready(function(){
$(document).delegate('.ac_even', 'click', function(){
str = $('.replace').val();
str = str.replace('İ', 'i');
$('.replace').val(str);
});
$('.replace').focusout(function(){
str = $(this).val();
str = str.replace('İ', 'i');
$(this).val(str);
}).keyup(function() {
str = $(this).val();
str = str.replace("İ", "i");
$(this).val(str);
});
});
See:
How do you trigger autocomplete "select" event manually in jQueryUI?
so this will work if you focus out and if you hit something on the keyboard the Input/textarea and will do something.