The code we're using is below - it also includes functions to replace zeros with blank space and widens the input boxes:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var a = 0;
var b = 0;
while (a<6){
while (b<9){
if(this.getChoiceValue(a,b) == 0) {
this.setChoiceValue(a,b,"");
}
b++;
}
b = 0;
a++;
}
{
var inputWidth = "75px";
var q = jQuery("#"+this.questionId);
q.find('Input').css("width", inputWidth);
q.find('.SumInput').css("width", inputWidth);
q.find('.SumTotal').css("width", inputWidth);
q.find('.InputText').css("width", inputWidth);
};
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
this.questionclick = function(event,element){
var i =0; /*Setting column number for loopage*/
while (i<9){
var a = parseInt(this.getChoiceValue(1,i),10);
var b = parseInt(this.getChoiceValue(2,i),10);
var c = parseInt(this.getChoiceValue(3,i),10);
var d = parseInt(this.getChoiceValue(4,i),10);
var e = parseInt(this.getChoiceValue(5,i),10);
if(isNaN(a)){ /*check if div by 0*/
a= 0;
}
if(isNaN(b)){ /*check if div by 0*/
b= 0;
}
if(isNaN(c)){ /*check if div by 0*/
c= 0;
}
if(isNaN(d)){ /*check if div by 0*/
d= 0;
}
if(isNaN(e)){ /*check if div by 0*/
e= 0;
}
var x = a+b+c+d+e ;
this.setChoiceValue (6,i,x);
/*Increase column number*/
i++;
}}
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Any ideas on the error??
Thanks,
RoseAnyone know what this error message means?
The code we're using is below - it also includes functions to replace zeros with blank space and widens the input boxes:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
var a = 0;
var b = 0;
while (a<6){
while (b<9){
if(this.getChoiceValue(a,b) == 0) {
this.setChoiceValue(a,b,"");
}
b++;
}
b = 0;
a++;
}
{
var inputWidth = "75px";
var q = jQuery("#"+this.questionId);
q.find('Input').css("width", inputWidth);
q.find('.SumInput').css("width", inputWidth);
q.find('.SumTotal').css("width", inputWidth);
q.find('.InputText').css("width", inputWidth);
};
});
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
this.questionclick = function(event,element){
var i =0; /*Setting column number for loopage*/
while (i<9){
var a = parseInt(this.getChoiceValue(1,i),10);
var b = parseInt(this.getChoiceValue(2,i),10);
var c = parseInt(this.getChoiceValue(3,i),10);
var d = parseInt(this.getChoiceValue(4,i),10);
var e = parseInt(this.getChoiceValue(5,i),10);
if(isNaN(a)){ /*check if div by 0*/
a= 0;
}
if(isNaN(b)){ /*check if div by 0*/
b= 0;
}
if(isNaN(c)){ /*check if div by 0*/
c= 0;
}
if(isNaN(d)){ /*check if div by 0*/
d= 0;
}
if(isNaN(e)){ /*check if div by 0*/
e= 0;
}
var x = a+b+c+d+e ;
this.setChoiceValue (6,i,x);
/*Increase column number*/
i++;
}}
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Any ideas on the error??
Thanks,
RoseBest answer by LaurenK
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.
