Hi there,
Some background on what I'm trying to accomplish in general: I'm trying to create an experiment with a task where the participant/user has to calculate the sum of 4 random 2-digit numbers (e.g. 40 + 33 + 20 + 99 = ...). In the same block, the user has a maximum of 25 sums to be solved with a time limit of 4 minutes. After these 4 minutes, the survey should move on to the next block automatically. I created some form validation with JavaScript to check if the user's input is correct (i.e. the calculation is correct). If it is correct then the user should be allowed to advance to the next question, if it is wrong the user receives an error message and is not allowed to proceed.
My problem: I've dissabled the Qualtrics-next button and created a custom-next button where, if the custom-next button is clicked, the Qualtrics-next button is clicked (following this discussion https://www.qualtrics.com/community/discussion/3273/getting-started-with-question-javascript). The problem now is that this only seems to be working for the first question, but not for any questions following after that.
var nextButton1 = document.querySelector(".NextButton")
if(Sum === userInput)
{
nextButton1.click()
}
else
{
ValidationError.innerHTML = "Incorrect answer"
}
This thus only works for question 1, but not for question 2-25. Does someone have any alternatives/suggestions?
How to click on next-button with Javascript for multiple questions in the same block.
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.
