Hi all. There have been some great resources on this forum for us non-coders to be able to do date math. Thank you!
I am working to create a mini-database in Qualtrics. The flow of the form means the last field I enter is a date. However, that field needs used to calculate a time span between it an an earlier entered date.
All of the examples I have seen put Javascript on a question on the next page in the Onload function. In my case I don't have a next page and question. Is there somewhere else to put this or a way to force the calculation while on the same page as the question? It doesn't make sense for the data entry clerks to have to navigate through an extra page every time they go to enter a case.
How to do math when question is the last one in your survey?
Best answer by TomG
https://community.qualtrics.com/XMcommunity/discussion/comment/47502#Comment_47502You don't need to hardcode the previous question. You can do this:
var q = jQuery("#"+this.questionId); //the current question
var pq = q.prevAll(".QuestionOuter").first(); // the previous question
var textDateID4 = moment(pq.find(".InputText").val());
var textDateID5 = moment(q.find(".InputText").val());
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.
