- Posts: 25
- Thank you received: 6
Ask the community, share ideas, and connect with other LimeSurvey users!
{str_replace( "É","E", str_replace("È","E", str_replace(" ","", str_replace("'","", str_replace("Ê","E", str_replace("Ë","E", strtoupper(html_entity_decode(nom)) ) ) ) ) ) )}
$(function() { $(".question-container.accentsTidy .text-item > textarea").on("change", function() { $(this).val(accentsTidy($(this).val())); }); $(".question-container.accentsTidy .text-item > input:text").on("change", function() { $(this).val(accentsTidy($(this).val())); }); });
accentsTidy = function(s){ var r=s.toLowerCase(); r = r.replace(new RegExp(/\s/g),""); r = r.replace(new RegExp(/[àáâãäå]/g),"a"); r = r.replace(new RegExp(/æ/g),"ae"); r = r.replace(new RegExp(/ç/g),"c"); r = r.replace(new RegExp(/[èéêë]/g),"e"); r = r.replace(new RegExp(/[ìíîï]/g),"i"); r = r.replace(new RegExp(/ñ/g),"n"); r = r.replace(new RegExp(/[òóôõö]/g),"o"); r = r.replace(new RegExp(/œ/g),"oe"); r = r.replace(new RegExp(/[ùúûü]/g),"u"); r = r.replace(new RegExp(/[ýÿ]/g),"y"); r = r.replace(new RegExp(/\W/g),""); return r; }; $(function() { $(".question-container.accentsTidy .text-item > textarea").on("change", function() { $(this).val(accentsTidy($(this).val())); }); $(".question-container.accentsTidy .text-item > input:text").on("change", function() { $(this).val(accentsTidy($(this).val())); }); });