A major goal of our recruitment survey is to identify users who are between the ages of 14-24 (target population) and those who are not (not eligible for our study). Currently we ask users for their date of birth (MM/DD/YYYY) and would like to use JS to: 1. Calculate age, based on the current date 2. Determine if the age is within our target range (14-24) 3. Provide a validation alert to the users AND/OR categorize users using embedded data in the categories of eligible/ineligible based on age Please take a look at the code I have now for the DOB question: Qualtrics.SurveyEngine.addOnReady(function() { var dob_entry = getTextValue(); var split_dob = dob_entry.split("/"); var month = split_dob[0]; var day = split_dob[1]; var year = split_dob[2]; var dob_asdate = new Date(year, month, day); var today = new Date(); var mili_dif = Math.abs(today.getTime() - dob_asdate.getTime()); var age = (mili_dif / (1000 * 3600 * 24 * 365.25)); within_a
Hi, I have a list of zip codes that are included and excluded in a local delivery service. I would like respondents to enter their zip codes and receive a message (or skip logic) that they are eligible or ineligible based on the zip code look up. How could this be done with JavaScript and custom validation or display logic? The list of zip codes is probably between 100-200 entries.
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.