@fleb That worked! The question choice was actually 23. I used the question click example from the javascript question api to tell me that: this.questionclick = function(event,element){ //for a single answer multiple choice question, the element type will be radio if (element.type == 'radio') { var choiceNum = element.id.split('~')[2]; alert('You clicked on choice '+choiceNum); } } The only issue or question I have now, is if it's possible to format the text. In the survey flow, I can use HTML. Am I able to use HTML in JS? It seemed like it was treating it as part of the JS code. Thanks!
@TomG This works. Thanks so much. Also, I really like how your demo survey automatically adds the '/' to assist with the date format. Would you be willing to help me learn how to do that?
@TomG Basically, I want it to treat it like the baked in content validation and not allow the participant to proceed with the survey if the age is > 18, and to give them an error message. The birthdate is the first question. We've already collected it in a database application (Filemaker) that is passing some information to Qualtrics. It's not in the process currently, but it would probably be a good idea for me to pass the birthdate from Filemaker and create a flag if it doesn't match the birthdate entered into Qualtrics.
@TomG I want to create a validation message if the age is above > 18. Is there a way to do this without them submitting their response?
I got it to work, I didn't need to change anything. My apologies.
@TomG I'm sorry, I'm not familiar with JS. So, I put this in the question html: ! but I'm not sure how to edit the JS that you provided. Where do I put the QID? Is there anything else that I need to change? I set an "Age" variable in the survey flow. Thanks so much for your help.
Using Mohammedali_Rajapakar_Ugam's method, I can't get the value from the text entry field for QYear to pipe in. I've tried using a form field to ask for the date in YYYY/MM/DD and MM/DD/YYYY formats.
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.