Wow! works perfectly!
I used this code in the ClientEvend dialog box to convert a field to a slug (string suitable to be used as URL parameter):
$('#ctrl-field1').on('change blur keyup', function(){
var alias = $('#ctrl-field1').val();
alias = alias.toLowerCase();
alias = alias.replace(/[àáâãäå]/g, 'a');
alias = alias.replace(/[èéêë]/g, 'e');
alias = alias.replace(/[ìíîï]/g, 'i');
alias = alias.replace(/[òóôõö]/g, 'o');
alias = alias.replace(/[ùúûü]/g, 'u');
alias = alias.replace(/[ýÿ]/g, 'y');
alias = alias.replace(/[^\w ]+/g,'');
alias = alias.replace(/ +/g,'-');
$('#ctrl-field2').val(alias)
});
HTH
Thanks Willvin
Ciao
Tony