Hello, I have a project where the user has to enter french text. I need a a set of French special letters to popup. I have tried https://www.codehim.com/demo/jquery-special-characters-input/ but it didn’t work:( The css is off, but the most important, if I press the letter, it doesn’t go into the text field. Do you have any suggestions?
this is my survey: https://brown.co1.qualtrics.com/jfe/form/SV_3JcmoQLaTCANB4i
Solved
I need to add pop-up french characters
Best answer by Deepak
Try this:
Qualtrics.SurveyEngine.addOnload(function() {
var button = document.createElement("button");
button.innerHTML = "French Special Letters";
document.querySelector("#" + this.questionId + " .QuestionBody").appendChild(button);
var dialog = document.createElement("div");
dialog.id = "specialCharsDialog";
dialog.title = "French Special Letters";
dialog.style.display = "none";
var specialChars = ['à', 'â', 'æ', 'ç', 'é', 'è', 'ê', 'ë', 'î', 'ï', 'ô', 'œ', 'ù', 'û', 'ü'];
specialChars.forEach(function(char) {
var specialButton = document.createElement("button");
specialButton.classList.add("specialChar");
specialButton.innerHTML = char;
dialog.appendChild(specialButton);
});
document.querySelector("#" + this.questionId + " .QuestionBody").appendChild(dialog);
var isDialogVisible = false;
button.addEventListener("click", function() {
if (!isDialogVisible) {
document.getElementById("specialCharsDialog").style.display = "block";
} else {
document.getElementById("specialCharsDialog").style.display = "none";
}
isDialogVisible = !isDialogVisible; // Toggle the display status
});
var specialCharButtons = document.querySelectorAll("#" + this.questionId + " .specialChar");
specialCharButtons.forEach(function(button) {
button.addEventListener("click", function() {
var char = button.innerHTML;
var inputField = document.querySelector(".InputText");
var currentText = inputField.value;
inputField.value = currentText + char;
});
});
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

