Hi there, I am trying to have the input of a text box both appear and be stored in uppercase. I found the following line here, however it's not working for me and I wonder if it's clashing with my existing code.
Here's the line I want to integrate:
jQuery("#"+this.questionId+" .InputText").on("input", function() { this.value = this.value.toUpperCase(); });
And here is my existing code:
Qualtrics.SurveyEngine.addOnload(function() {
//hide next button
this.hideNextButton();
//press enter to go to next question
document.on("keydown", function(e) {
if (e.keyCode === 13) $('NextButton').click();
});
});
Qualtrics.SurveyEngine.addOnReady(function(){
//cursor in text box
$(this.questionId).down('.InputText').focus().defer();
});
Have tried putting the new line in each of the Onload and OnReady functions.
I'm new to javascript so apologies if I'm missing something very obvious
How to capitalise input to a text box?
Best answer by rmuoa
Never mind I answered my own question! I will leave it up in case this helps anyone else though - the solution was to put it before the cursor line within the OnReady function, for some reason it did not work if I put it second.
Qualtrics.SurveyEngine.addOnload(function() {
//hide next button
this.hideNextButton();
//press enter to go to next question
document.on("keydown", function(e) {
if (e.keyCode === 13) $('NextButton').click();
});
});
Qualtrics.SurveyEngine.addOnReady(function(){
//capitalise text entry
jQuery("#"+this.questionId+" .InputText").on("input", function() { this.value = this.value.toUpperCase(); });
//cursor in text box
$(this.questionId).down('.InputText').focus().defer();
});
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
