EQ-5D Registration FormFast Track
No license agreement needed. We aim to deliver EQ-5D within 5 business days after you have agreed to the Terms of Use.Standard
A license agreement is needed. EQ-5D can be only delivered once an agreement has been set up, negotiated and signed. Within 10 business days a representative from the EuroQol Office will be in contact.Priority
Commercial registration. Priority Route selected. Response time for commercial requests is 5 business days.
We noticed that you are using the browser [browser]. Unfortunately, the EQ-5D Registration form only functions with [min_browser] or other recent browsers. Please upgrade your browser and try again. If you have any questions, please contact
Please note: the EuroQol Office team is working from home
As a result of the Covid-19 crisis the EuroQol Office team is working from home. The current situation may impact our ability to respond to telephone and email requests in a timely manner. We kindly ask for your understanding.
During this time, the preferred way to contact the Office team is by email: userinformationservice@euroqol.org. We will then respond as quickly as possible.
The EuroQol Research Foundation is a registered non-profit organization in the Netherlands. The Foundation serves as the single point of distribution of the family of EQ-5D instruments.
No licence fee will be charged if the EQ-5D is used for a non-commercial purpose. For example, if EQ-5D is used in a non-commercial research project, or in a hospital for a non-commercial purpose such as clinical use or routine outcome measurement. For most requests you will only need to agree to our Terms of Use in order to obtain EQ-5D. However, please note that in some cases a license agreement and/or a digital cost recovery fee may be required (see the License Policy for more information).
A license fee will be charged for commercial use of the EQ-5D. For example, if EQ-5D is used by or on behalf of a pharmaceutical company, medical device manufacturer or any other for-profit company. See our License Policy for more information on our commercial license fee structure. Commercial requests will be handled with priority. The response time for commercial requests is 5 business days.
Please indicate below whether you will use the EQ-5D for a commercial- or a non-commercial study/project/purpose:
The EuroQol Research Foundation’s legal department will review your registration and will determine the applicable policy.
';
$("#results-tab-5 table tbody").append(values);
}
return;
}
if($( this ).find("td[class*='omitValues']").length > 0){
return;
}
var label = $( this ).find("td:nth-child(1)");
var value = $( this ).find("td:nth-child(2) input").not("[type=radio],[type=checkbox]");
value = value.length !=0 ? value.val() : undefined;
if (value === undefined) {
var value = $( this ).find("td:nth-child(2) select");
value = value.length !=0 ? value.val() : undefined;
if (value != null) {
value = value.toString().replace(/,/g,', ');
}
}
if (value === undefined) {
var value = $( this ).find("td:nth-child(2) textarea");
value = value.length !=0 ? value.val() : undefined;
}
if (value === undefined) {
var value = $( this ).find("td:nth-child(2) input[type=radio]:checked");
value = value!== undefined ? value.val() : undefined;
if (value !== undefined) value = value === "1" ? "Yes" : "No";
}
if (value === undefined) {
var value = $( this ).find("td:nth-child(2) input[type=checkbox]");
value = value.length !=0 ? value.is(':checked') : undefined;
if (value !== undefined) value = value === true ? "Yes" : "No";
}
if (value === undefined) {
value = "No selection";
}
if ($('#regtype').val() == '1') {
if (label.text().indexOf("Please specify other intended") == -1 && label.text().indexOf("Please specify other design") == -1) {
if (label.text().indexOf("Please be informed") == -1 && label.text().indexOf("Please note") == -1) {
if (label.text().trim() != '' && label.text() != 'Confirm the form submission') {
if (label.text().trim() == 'Email*') {
if ($('#email_status').val() == 'good') {
$("#results-tab-5 table tbody").append('
');
$('form#registration input#goback').click(function() {
if ($('#regtype').val() == '1') {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "option", "active", 1 );
window.scrollTo(0, 0);
} else {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "option", "active", 0 );
window.scrollTo(0, 0);
}
});
var recaptchaLoaded = $("div.g-recaptcha iframe").length;
if(recaptchaLoaded == 0){
$("div.g-recaptcha").hide();
$("#securimage_captcha").show();
}else{
$("#securimage_captcha").hide();
$("#siwp_captcha_value_0").val('')
$("div.g-recaptcha").show();
}
$('#submit').click(function(e) {
var valid = validateAll(e, $(this));
var startDate = Date.now();
var endDate = new Date($('#dateOfAvailability').val());
if (valid && (isNaN(startDate) || isNaN(endDate) || startDate > endDate ) ) {
setCrossBrowserCustomValidity($('#dateOfAvailability'), 'Date must be in the future');
valid = false;
} else {
setCrossBrowserCustomValidity($('#dateOfAvailability'), '');
}
var end_date = endDate.getDate().toString();
var end_month = String(endDate.getMonth()+1);
var end_year = endDate.getFullYear().toString();
var endDateString = end_date + "-" + end_month + "-" + end_year;
$("#00N1r00000HHVA3").val(endDateString);
/*var response = grecaptcha.getResponse();
if (response.length === 0) {
alert("Captcha is not validated, the registration form will not be submitted.");
return false;
} else {
$('').hide().appendTo('form#registration').click().remove();
}*/
if(valid){
$('#registration').submit();
}
});
}
});
$(document).on('submit', '#registration', function (e) {
var valid = validateAll(e, $('#submit'));
var startDate = Date.now();
var endDate = new Date($('#dateOfAvailability').val());
if (($('#00N1r00000HHVAT').val()=="") && ($('#00N1r00000HHVAU').val()==""))
{
e.preventDefault();
alert('Please select at least 1 EQ-5D version');
return false;
}
if ($('#00N1r00000HHVAU').val()!="") {
if (isNaN(endDate) || startDate > endDate )
{
e.preventDefault();
setCrossBrowserCustomValidity($('#dateOfAvailability'), 'Date must be in the future');
return false;
} else {
setCrossBrowserCustomValidity($('#dateOfAvailability'), '');
var end_date = endDate.getDate().toString();
var end_month = String(endDate.getMonth()+1);
var end_year = endDate.getFullYear().toString();
var endDateString = end_date + "-" + end_month + "-" + end_year;
$("#00N1r00000HHVA3").val(endDateString);
}
}
} );
var productsSelected = null;
function sortFormProducts(ea, eb) {
var a = $(ea);
var b = $(eb);
var keya = a.attr("data-sort-instrument") + " " + a.attr("data-sort-moa") + " " + a.attr("data-sort-country") + " " + a.attr("data-sort-language");
var keyb = b.attr("data-sort-instrument") + " " + b.attr("data-sort-moa") + " " + b.attr("data-sort-country") + " " + b.attr("data-sort-language");
return keya > keyb ? 1 : -1;
};
function sortFormProductsByName(ea, eb) {
var a = $(ea);
var b = $(eb);
var keya = a.attr("data-sort-country") + " " + a.attr("data-sort-language");
var keyb = b.attr("data-sort-country") + " " + b.attr("data-sort-language");
return keya > keyb ? 1 : -1;
};
var selectedLanguages = [];
var selectedModes = [];
var selectedModeLanguages = [[]];
function addMode(index, value, isOther) {
// if there are no languages yet, just add new mode definition
selectedModes.splice(index, 0, { value : value, other : isOther }) ;
if(selectedLanguages.length == 0){
}else{
for(var i = 0; i < selectedLanguages.length; i++){
if(selectedModeLanguages.length < selectedLanguages.length){
selectedModeLanguages.push([]);
}
var avail = isAvailable(selectedLanguages[i].value, value);
selectedModeLanguages[i].splice(index, 0, { available : avail, requested : avail ? true : false } ) ;
}
}
}
function addLanguage(index, value, isOther) {
// if there are no modes yet, just add new language definition
for(var i = 0; i < selectedLanguages.length; i++){
if(selectedLanguages[i]== value){
return;
}
}
selectedLanguages.splice(index, 0, { value : value, other : isOther }) ;
if(selectedModes.length == 0 ){
}else{
selectedModeLanguages.splice(index, 0, []);
for(var i = 0; i < selectedModes.length; i++){
var avail = isAvailable(selectedLanguages[index].value, selectedModes[i].value);
selectedModeLanguages[index][i] = { available : avail, requested : avail ? true : false };
}
}
}
function removeMode(index){
for(var i = 0; i < selectedLanguages.length; i++){
selectedModeLanguages[i].splice(index, 1);
}
for(var i = selectedModeLanguages.length - 1; i >=0; i-- ){
if(selectedModeLanguages[i].length == 0){
selectedModeLanguages.splice(i, 1);
}
}
selectedModes.splice(index, 1);
}
function removeLanguage(index){
selectedModeLanguages.splice(index, 1);
selectedLanguages.splice(index, 1);
}
function processModesLanguagesTable(modes, languages, table){
// if ($('#regtype').val() == '1') {
// var result = $.grep(modes, function(e){
// return e.value.indexOf("REDCap") == -1;
// });
// modes = result;
// }
var languages_column = $('#languages_column tbody').empty();
for(var i = 0; i < languages.length; i++){
var newlyRequestedClass = languages[i].other ? " newMoa " : "";
var countryName = getCountryName(languages[i].value);
var selectorPart = "data-country='" + countryName + "'";
var elemHtml = "
" + languages[i].value + "
";
languages_column.append(elemHtml);
}
var modes_row = $('#modes_row tbody').empty();
modes_row.append('
');
modes_row = $(modes_row).find('tr:first');
for(var i = 0; i < modes.length; i++){
var newlyRequestedClass = modes[i].other ? " newMoa " : "";
var elemHtml = "
" + modes[i].value + "
";
modes_row.append(elemHtml);
}
var valueTable = $('#products_selected tbody').empty();
valueTable = $('#products_selected');
for(var i = 0; i < selectedLanguages.length; i++){
var language = selectedLanguages[i].value;
var countryName = getCountryName(languages[i].value);
var selectorPart = "data-country='" + countryName + "'";
var sortLanguage = getLanguage(language);
var sortCountryName = getCountryName(language);
elemHtml = $("
");
for(var j = 0; j < selectedModes.length; j++){
var value = selectedModes[j].value;
var modeGroup = getModeGroup(value);
var sortMoa = getInstrument(value);
var sortInstrument = modeGroup;
var available = selectedModeLanguages[i][j].available;
var device = modeDevices[value];
var isOther = selectedModes[j].other || selectedLanguages[i].other;
var id = getId(language, value);
elemHtml.append($("
"));
}
valueTable.append(elemHtml);
}
}
function processMode(index, value, isOther) {
isOther = !!isOther;
var newlyRequestedClass = isOther ? " newMoa " : "";
var table = $('#modes_row');
var modeGroup = getModeGroup(value);
var sortMoa = getInstrument(value);
var sortInstrument = modeGroup;
var ind = Math.max(index - 1, 0);
var elemHtml = "
");
}
var langTable = $('#languages_column');
var valueTable = $('#products_selected');
if($(langTable).find('tr.values').length > $(valueTable).find('tr').length){
langTable.find('tr.values').each(function (i,v) {
var lang_country = $(v).attr('data-country');
var products_country = $(valueTable).find('tr.values:eq('+ i +')').attr('data-country');
if( lang_country != products_country){
$(valueTable).find('tr.values').eq(i).before($(v).clone().empty());
}
});
}
/*if(valueTable.find('tr').length == 0){
valueTable.append('
');
}*/
valueTable.find('tr').each(function (i,v) {
var tr = $(v);
var language = langTable.find('tr:eq('+ i + ') td:first').data('value');
if(language == undefined) return;
var sortLanguage = getLanguage(language);
var sortCountryName = getCountryName(language);
var available = isAvailable(language, value);
var device = modeDevices[value];
elemHtml = "
";
if(tr.find('td').length > 0){
if(index == 0) {
tr.find('td').eq(0).before(elemHtml);
}else{
tr.find('td').eq(index - 1).after(elemHtml);
}
}else{
tr.append(elemHtml);
}
});
}
/*
function removeMode(index) {
var table = $('#modes_row');
table.find('tr').each(function (i,v) {
$(v).find('th').eq(index).remove();
});
if($(table).find('tr th').length == 0){
$(table).find('tr').remove();
}
table = $('#products_selected');
table.find('tr').each(function (i,v) {
$(v).find('td').eq(index).remove();
});
}*/
function getId(language, mode) {
var key = language + "|" + mode;
var id = '';
var available = (!!languagesAndModesId[key]);
if (available) {
id = languagesAndModesId[key];
}
return id;
}
//for tests only!!!
function isAvailable(language, mode) {
var key = language + "|" + mode;
var available = (!!languagesAndModesAvailable[key]);
return available;
}
function getCountryName(val) {
var start = val.indexOf('(') + 1;
var end = val.indexOf(')');
return val.substring(start, end);
}
function getLanguage(val) {
var end = val.indexOf('(') - 1;
return val.substring(0, end);
}
function getModeGroup(val) {
if(val.indexOf('Newly requested MoA') >= 0){
return "Newly requested MoA's";
}else{
var end = val.indexOf(' ');
return val.substring(0, end).trim();
}
}
function getInstrument(val) {
if(val.indexOf('Newly requested MoA') >= 0){
return "";
}else{
var end = val.indexOf(' ');
return val.substring(end).trim();
}
}
function processLanguage(index, value, isOther) {
var table = $('#modes_row');
var langTable = $('#languages_column');
var countryName = getCountryName(value);
var selectorPart = "data-country='" + countryName + "'";
var sortCountryName = getCountryName(value);
var sortLanguage = getLanguage(value);
var elemHtml = '';
if(!isOther){
elemHtml = $("
" + value + "
");
}else{
elemHtml = $("
" + value + "
");
}
if(index - 1 < 0){
}
var ind = Math.max(index - 1, 0);
var row = langTable.find('tr').eq(ind);
if(row.length > 0){
if(index - 1 < 0){
row.before(elemHtml);
}else{
row.after(elemHtml);
}
}else{
langTable.append(elemHtml);
}
var valueTable = $('#products_selected');
if($(langTable).find('tr.values').length > $(valueTable).find('tr').length){
langTable.find('tr.values').each(function (i,v) {
var lang_country = $(v).attr('data-country');
var products_country = $(valueTable).find('tr.values:eq('+ i +')').attr('data-country');
if( lang_country != products_country){
if(i > $(valueTable).find('tr.values').length){
//$(valueTable).find('tr.values').after($(v).clone().empty());
}else {
//$(valueTable).find('tr.values').eq(i).before($(v).clone().empty());
}
}
});
}
var columnsCount = table.find("tr:last th").length;
elemHtml = $("
");
for (var k = 0; k < columnsCount; k++) {
var mode = table.find('tr:last th').eq(k).data('value');
var sortMoa = getInstrument(mode);
var sortInstrument = getModeGroup(mode);
var available = isAvailable(value, mode);
//var isOther = countryName == "Newly requested languages";
var device = modeDevices[mode];
var checkbox = $("
");
elemHtml.append(checkbox);
}
var valueTableRow = $('#products_selected tr:eq(' + ind + ')');
if(valueTableRow.length > 0){
if(index - 1 < 0){
valueTableRow.before(elemHtml);
}else{
valueTableRow.after(elemHtml);
}
}else{
$('#products_selected').append(elemHtml);
}
}
function addProductsSelectedModeGroupHeaders() {
var table = $('#modes_row');
var firstTr = table.find("tr:first");
if (firstTr.attr('id') === 'modeGroupHeaders') {
return;
}
var clone = firstTr.clone();
clone.attr('id', 'modeGroupHeaders')
firstTr.before(clone);
//table.find("tr:first th:first").text('')
table.find("tr:first th").slice(0).each(function (i,v) {
var td = $(v);
var modeGroup = getModeGroup(td.data('value'));
td.attr('data-mode-group', modeGroup);
td.removeAttr('data-value');
td.text(modeGroup);
td.addClass('modeGroupHeader');
td.removeClass('tdMode');
});
var modeGroupHeaders = table.find("tr:first th[data-mode-group]").get();
var modeGroupTd = null;
var modeGroup = ''; //modeGroupTd.data('mode-group');
var sameModeGroups = 1;
for(var k = 0; k < modeGroupHeaders.length; k++) {
var td = $(modeGroupHeaders[k]);
var nextModeGroup = td.data('mode-group');
if (nextModeGroup == modeGroup) {
sameModeGroups++;
td.remove();
} else {
if (modeGroupTd != null) {
modeGroupTd.attr('colspan', sameModeGroups);
}
modeGroupTd = td;
sameModeGroups = 1;
modeGroup = nextModeGroup;
}
}
if(modeGroupTd != null){
modeGroupTd.attr('colspan', sameModeGroups);
}
}
function addProductsSelectedCountryHeaders() {
var table = $('#languages_column');
if (table.find('tr.productsSelectedCountryHeaders').length > 0) {
return;
}
var elems = table.find("tr").slice(0).get();
var countryName = '';
var shift = 0;
for(var k = 0; k < elems.length; k++) {
var tr = $(elems[k]);
if($(tr).find('td').length == 0 ){
return;
}
var ind = Math.max(k - 1, 0);
var landTr = $("#languages_column td").eq(k + shift);
var language = getLanguage(selectedLanguages[k].value);
var nextCountryName = getCountryName(selectedLanguages[k].value);
var columnsCount = selectedModes.length;
if(selectedLanguages[k].other){
nextCountryName = 'Newly requested languages';
}
if (nextCountryName !== countryName) {
$('#products_selected tr').eq(k + shift).before("
");
landTr.parent().before("
"+ nextCountryName + "
");
shift++;
}
countryName = nextCountryName;
}
}
function removeProductsSelectedCountryHeaders() {
var table = $('#products_selected');
table.find("tr.productsSelectedCountryHeaders").remove();
table = $('#languages_column');
table.find("tr.productsSelectedCountryHeaders").remove();
}
function removeProductsSelectedModeGroupHeaders() {
var table = $('#modes_row');
table.find("tr#modeGroupHeaders").remove();
}
/*
function removeLanguage(index) {
var table = $('#products_selected');
table.find('tr').eq(index).remove();
table = $('#languages_column');
table.find('tr').eq(index).remove();
}*/
function removeOtherCountriesValues() {
/*var table = $('#products_selected');
table.find('tr td.other ').parent().remove();
table.find('tr.values:not(:has(td))').remove();
table = $('#languages_column');
table.find('tr td.other ').parent().remove();*/
for(var i = selectedLanguages.length - 1; i >= 0; i-- ){
if(selectedLanguages[i].other){
removeLanguage(i);
}
}
}
function addOtherCountriesValues() {
var table = $('#products_selected');
if (table.find('tr[data-country="Other"]').length > 0) { return };
var nonEmpty = $('tr.otherCountryLanguages').filter(function () {
return !!($(this).find('input.otherCountries').val() && $(this).find('input.otherLanguages').val());
}).each(function(i, v) {
var input = $(v);
var country = $(input).find('input.otherCountries').val();
var lang = $(input).find('input.otherLanguages').val();
addLanguage(selectedLanguages.length, lang + ' (' + country + ')', true);
});
}
function removeOtherModesOfAdministrationValues() {
/*var table = $('#modes_row');
table.find('th.newMoa').remove();
table = $('#products_selected');
table.find('td.newMoa').remove();*/
for(var i = selectedModes.length - 1; i >= 0; i-- ){
if(selectedModes[i].other){
removeMode(i);
}
}
}
function addOtherModesOfAdministrationValues() {
var table = $('#modes_row');
if (table.find('th.newMoa').length > 0) { return };
var nonEmpty = $('input.otherModesOfAdministration[type="text"]').filter(function () {
return !!this.value;
}).each(function(i, v) {
var input = $(v);
var index = table.find('tr:eq(1) th').length;
if(index < 1){
index = table.find('tr:eq(0) th').length;
}
addMode(selectedModes.length, input.val() + " (Newly requested MoA\'s)", true);
});
}
function addProductTableHeaders() {
addProductsSelectedCountryHeaders();
addProductsSelectedModeGroupHeaders();
$('#languages_column').find('tr').each(function (i,v) {
var tr = $(v);
var newHeight = tr.height();
var oldHeight = $('#products_selected').find('tr:eq('+ i + ')').height(newHeight);
});
$('.colrowHeader').height($('.fixedTable-header').height());
}
var otherCheckedStored = [];
function removeProductTableHeaders() {
removeProductsSelectedCountryHeaders();
removeProductsSelectedModeGroupHeaders();
removeOtherModesOfAdministrationValues();
removeOtherCountriesValues();
}
// validate tab on "send" button and move to the next tab if fine
function validateEmail(email) {
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
$('input.buttonBack, input.buttonBackWider').click(function(e) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected - 1 );
$( "#tabs" ).tabs( "option", "active", selected - 1 );
window.scrollTo(0, 0);
});
$.webshims.validityMessages['en'] = {
valueMissing : {
defaultMessage: 'Please complete this field'
}
};
function validateAll(e, dis) {
/*load english localization*/
$.webshims.activeLang("en");
var valid = true;
if($('#tabs-1a').is(":visible")) {
valid = true;
} else {
dis.closest('table').find('.required').removeClass('required').prop('required','true');
dis.closest('table').find('*[required]').each(function( index ) {
if(valid && !$(this).checkValidity()) {
valid = false;
}
});
if (valid){
var currentTab = dis.closest('.ui-tabs-panel').index();
$('#tabs .required, #tabs *[required]').each(function( index ) {
if(valid){
var ind = $(this).closest('.ui-tabs-panel').index();
if(ind < currentTab){
$(this).prop('required','true');
if(!$(this)[0].checkValidity()) {
valid = false;
$(this).prop('required','false');
}
}
}
});
}
if (valid && !validateEmail($('#email').val())) {
setCrossBrowserCustomValidity($('#email'), 'Please enter a valid e-mail address.');
valid = false;
} else {
setCrossBrowserCustomValidity($('#email'), '');
}
if (valid && $('#phone').val().length < 8 ) {
setCrossBrowserCustomValidity($('#phone'), 'Please enter a valid phone number.');
valid = false;
} else {
setCrossBrowserCustomValidity($('#phone'), '');
}
// start date must not be after end year
var startDate = $('#00N1r00000HHVAX').val();
var endDate = $('#00N1r00000HHVAA').val();
if (valid && (isNaN(startDate) || isNaN(endDate) || parseInt(startDate) > parseInt(endDate) ) ) {
setCrossBrowserCustomValidity($('#00N1r00000HHVAA'), 'End Year must be equal to or after Start Year.');
valid = false;
} else {
setCrossBrowserCustomValidity($('#00N1r00000HHVAA'), '');
}
var numberOfPatients = $('#00N1r00000HHVAG').val();
if (valid && (isNaN(numberOfPatients) || parseInt(numberOfPatients) < 0 ) ) {
setCrossBrowserCustomValidity($('#00N1r00000HHVAG'), 'Number of patients must be a number >= 0.');
valid = false;
} else {
setCrossBrowserCustomValidity($('#00N1r00000HHVAG'), '');
}
}
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
// if ($('#regtype').val() == '1') {
// if ($('#tabs-1').is(":visible")) {
// $('#tabs-1').hide();
// $( "#tabs" ).tabs( "enable", selected + 2 );
// $( "#tabs-" + (selected + 3) + " *[required]").addClass('required').removeProp('required');
// $( "#tabs" ).tabs( "option", "active", selected + 2 );
// window.scrollTo(0, 0);
// } else {
// $( "#tabs" ).tabs( "enable", selected + 1 );
// $( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
// $( "#tabs" ).tabs( "option", "active", selected + 1 );
// window.scrollTo(0, 0);
// }
// } else {
// $( "#tabs" ).tabs( "enable", selected + 1 );
// $( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
// $( "#tabs" ).tabs( "option", "active", selected + 1 );
// window.scrollTo(0, 0);
// }
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$('form').checkValidity();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
return valid;
}
$('input.buttonNext,input.firstTabNextNew') .click(function(e) { validateAll(e, $(this)); } );
// var valid4 = false;
// $(document).on('click', '.firstTabNext', function (e) {
// if($('#regtype').val() != "1") {
// if ($('#title').val() != "" && $('#first_name').val() != "" && $('#last_name').val() != "" && $('#00N1r00000HHVAd').val() != "" && $('#company').val() != "" && $("[name=street]").val() != "" && $('#zip').val() != "" && $('#city').val() != "" && $('#country').val() != "" && validateEmail($('#email').val()) && $('#phone').val() != "") {
// // Get the modal
// var modal4 = document.getElementById('myModal4');
// var ok4 = document.getElementById("ok4");
// if (valid4 == false) {
// modal4.style.display = "block";
// }
// ok4.onclick = function() {
// valid4 = true;
// modal4.style.display = "none";
// if (valid4) {
// $('.firstTabNext').hide();
// $('.firstTabNextNew').show();
// }
// }
// }
// }
// });
$('input.thirdTabNext') .click(function(e) {
var valid = false;
$('#fromModal1').hide();
$('#fromModal2').hide();
// Get the modal
var modal1 = document.getElementById('myModal1');
var modal2 = document.getElementById('myModal2');
var ok1 = document.getElementById("ok1");
var ok2 = document.getElementById("ok2");
if (valid == false) {
if ($("#00N1r00000HHVAd").val() == 'University: student' || $("#00N1r00000HHVAd").val() == 'University: staff' || $("#00N1r00000HHVAd").val() == 'Hospital / Clinical Practice') {
if ($("#00N1r00000HHVA8").val() == 'Research (intend to publish the results)') {
if ($("#xxx").val().length > 1) {
if ($("#regtype").val() != "1") {
// valid = false;
// modal1.style.display = "block";
valid = true;
$('#fromModal1').show();
}
} else {
var xxx = $("#xxx").val();
if (xxx[0].indexOf('Digital') !== -1) {
if ($("#regtype").val() != "1") {
// valid = false;
// modal2.style.display = "block";
valid = true;
$('#fromModal2').show();
}
} else {
valid = true;
if ($("#countrySelect").val() == '') {
valid = false;
}
if ($("#xxx").val() == '') {
valid = false;
}
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
}
}
} else {
valid = true;
if ($("#countrySelect").val() == '') {
valid = false;
}
if ($("#xxx").val() == '') {
valid = false;
}
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
}
} else {
valid = true;
if ($("#countrySelect").val() == '') {
valid = false;
}
if ($("#xxx").val() == '') {
valid = false;
}
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
}
}
if ($("#countrySelect").val() == '') {
valid = false;
}
if ($("#xxx").val() == '') {
valid = false;
}
if (valid) {
$('.thirdTabNext').hide();
$('.thirdTabNextNew').show();
}
// var ok1 = document.getElementById("ok1");
// var ok2 = document.getElementById("ok2");
// ok1.onclick = function() {
// valid = true;
// if ($("#countrySelect").val() == '') {
// valid = false;
// }
// if ($("#xxx").val() == '') {
// valid = false;
// }
// modal1.style.display = "none";
// if (valid) {
// $('.thirdTabNext').hide();
// $('.thirdTabNextNew').show();
// }
// }
// ok2.onclick = function() {
// valid = true;
// if ($("#countrySelect").val() == '') {
// valid = false;
// }
// if ($("#xxx").val() == '') {
// valid = false;
// }
// modal2.style.display = "none";
// if (valid) {
// $('.thirdTabNext').hide();
// $('.thirdTabNextNew').show();
// }
// }
});
$('input.buttonNextWider').click(function(e) {
var valid = false;
if ($( ".available" ).length && $( ".unavailable" ).length && $( ".newMoa" ).length && $( ".other" ).length) {
if ($('.available :checkbox:checked').length > 0 || $('.unavailable :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".unavailable" ).length && $( ".newMoa" ).length && $( ".other" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.unavailable :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".unavailable" ).length && $( ".other" ).length && $( ".newMoa" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.unavailable :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".other" ).length && $( ".newMoa" ).length && $( ".unavailable" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".unavailable" ).length && $( ".other" ).length && $( ".newMoa" ).length && $( ".available" ).length == 0) {
if ($('.unavailable :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".unavailable" ).length && $( ".newMoa" ).length == 0 && $( ".other" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.unavailable :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".newMoa" ).length && $( ".unavailable" ).length == 0 && $( ".other" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".other" ).length && $( ".unavailable" ).length == 0 && $( ".newMoa" ).length == 0) {
if ($('.available :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".unavailable" ).length && $( ".newMoa" ).length && $( ".available" ).length == 0 && $( ".other" ).length == 0) {
if ($('.unavailable :checkbox:checked').length > 0 || $('.newMoa :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".unavailable" ).length && $( ".other" ).length && $( ".available" ).length == 0 && $( ".newMoa" ).length == 0) {
if ($('.unavailable :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".newMoa" ).length && $( ".other" ).length && $( ".available" ).length == 0 && $( ".unavailable" ).length == 0) {
if ($('.newMoa :checkbox:checked').length > 0 || $('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".available" ).length && $( ".unavailable" ).length == 0 && $( ".newMoa" ).length == 0 && $( ".other" ).length == 0) {
if ($('.available :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".unavailable" ).length && $( ".available" ).length == 0 && $( ".newMoa" ).length == 0 && $( ".other" ).length == 0) {
if ($('.unavailable :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".newMoa" ).length && $( ".available" ).length == 0 && $( ".unavailable" ).length == 0 && $( ".other" ).length == 0) {
if ($('.newMoa :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
} else if ($( ".other" ).length && $( ".available" ).length == 0 && $( ".unavailable" ).length == 0 && $( ".newMoa" ).length == 0) {
if ($('.other :checkbox:checked').length > 0) {
valid = true;
if (valid) {
var $tabs = $('#tabs').tabs();
var selected = $tabs.tabs('option', 'active');
$( "#tabs" ).tabs( "enable", selected + 1 );
$( "#tabs-" + (selected + 2) + " *[required]").addClass('required').removeProp('required');
$( "#tabs" ).tabs( "option", "active", selected + 1 );
window.scrollTo(0, 0);
} else {
$('form').checkValidity();
var newTabIndex = $('.first-invalid').closest('.ui-tabs-panel').index();
$( "#tabs" ).tabs( "enable", newTabIndex - 1 );
$( "#tabs" ).tabs( "option", "active", newTabIndex -1 );
}
} else {
valid = false
alert('Please select at least 1 EQ-5D version');
}
}
});
$(document).on('change', '.unavailable :checkbox, .other :checkbox, .newMoa :checkbox', function () {
// Get the modal
// var modal3 = document.getElementById('myModal3');
// var ok3 = document.getElementById("ok3");
// if(localStorage.getItem('popState') != 'shown'){
// modal3.style.display = "block";
// localStorage.setItem('popState','shown')
// }
// ok3.onclick = function() {
// modal3.style.display = "none";
// }
} );
$('#xxx') .change(function(e) {
// $('.thirdTabNextNew').hide();
// $('.thirdTabNext').show();
} );
var otherCountryWarning = $("#other_country_warning");
otherCountryWarning.toggle(false);
var otherModeOfAdministrationWarning = $("#other_mode_of_administration_warning");
$("tr#trOtherCountries").on('keyup', '.otherCountries, .otherLanguages', function () {
var nonEmpty = $('input.otherCountries[type="text"], input.otherLanguages[type="text"]').filter(function () {
return !!this.value;
}).length;
otherCountryWarning.toggle(nonEmpty != 0);
});
$("tr#trOtherModesOfAdministration").on('keyup', '.otherModesOfAdministration', function () {
var nonEmpty = $('input.otherModesOfAdministration[type="text"]').filter(function () {
return !!this.value;
}).length;
otherModeOfAdministrationWarning.toggle(nonEmpty != 0);
});
// additional information popups on Mode of Administration selection
$( "#xxx" )
.change(function () {
var msg = "";
$( "#xxx option:selected" ).each(function() {
//if ($( this ).text().indexOf("Digital (PDA)") !== -1 ) msg = "Please note the following: if you would like to use an EQ-5D PDA version and the EuroQol Research Foundation determines that a license fee is not required (small study), then a PDA version set-up fee of 500 Euros will be charged per study (n < 200).";
//if ($( this ).text().indexOf("Digital (Tablet)") !== -1 ) msg = "Please note the following: If you would like to use an EQ-5D Tablet version and the EuroQol Research Foundation determines that a license fee is not required, then a Tablet version set-up fee of 500 Euros will be charged for each small study (n < 200).";
//if ($( this ).text().indexOf("Digital (Web)") !== -1 ) msg = "Please note the following: If you would like to use an EQ-5D Web version and the EuroQol Research Foundation determines that a license fee is not required, then a Web version set-up fee of 500 Euros will be charged for each small study (n < 200).";
});
if (msg != "") alert(msg);
})
.change();
// dynamically show "Other" dropdowns
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
$('#00N1r00000HHVAd-other').hide();
$("#00N1r00000HHVAd").change(function () {
if (this.value.startsWith('Other')){
$('#00N1r00000HHVAd-other').show();
$('#00N1r00000HHVAL').addClass('required');
}
else{
$('#00N1r00000HHVAd-other').hide();
$('#00N1r00000HHVAL').removeClass('required').removeProp('required');
}
if (this.value.startsWith('University: student')){
alert('If you are registering for self-study use, please download the User Guide from the euroqol.org homepage');
}
});
$('#00N1r00000HHVA8-other').hide();
$(document).on('change', '#00N1r00000HHVA8', function () {
if (this.value.startsWith('Other')){
$('#00N1r00000HHVA8-other').show();
$('#00N1r00000HHVAI').addClass('required');
}
else {
$('#00N1r00000HHVA8-other').hide();
// $('#00N1r00000HHVAI').removeClass('required');
var a = document.getElementById("00N1r00000HHVAI");
a.classList.remove("required");
a.classList.remove("user-error");
a.removeAttribute("required");
}
});
$('#00N1r00000HHVA4-other').hide();
$(document).on('change', '#00N1r00000HHVA4', function () {
if (this.value.startsWith('Other')){
$('#00N1r00000HHVA4-other').show();
$('#00N1r00000HHVAK').addClass('required');
}
else {
$('#00N1r00000HHVA4-other').hide();
// $('#00N1r00000HHVAK').removeClass('required');
var a = document.getElementById("00N1r00000HHVAK");
a.classList.remove("required");
a.classList.remove("user-error");
a.removeAttribute("required");
}
if (this.value.startsWith('PROMs - Alberta')){
alert('For users from Alberta-Canada, please contact APERSU www.apersu.ca');
}
});
$('#00N1r00000HHVA1-other').hide();
$(document).on('change', '#00N1r00000HHVA1', function () {
if (this.value.startsWith('Other')){
$('#00N1r00000HHVA1-other').show();
$('#00N1r00000HHVAJ').addClass('required');
}else {
$('#00N1r00000HHVA1-other').hide();
var a = document.getElementById("00N1r00000HHVAJ");
a.classList.remove("required");
a.classList.remove("user-error");
a.removeAttribute("required");
}
});
$('#00N1r00000KXPSh-other').hide();
$('#plan_to_use_app_text').hide();
$("input:radio[name=00N1r00000KXPSh]").change(function () {
if (this.value === "1"){
$('#00N1r00000KXPSh-other').show();
$('#00N1r00000KXPSg').addClass('required');
$('#plan_to_use_app_text').show();
} else {
$('#00N1r00000KXPSh-other').hide();
var a = document.getElementById("00N1r00000KXPSg");
a.classList.remove("required");
a.classList.remove("user-error");
a.removeAttribute("required");
$('#plan_to_use_app_text').hide();
}
});
$('#00N1r00000HHVAN-other').hide();
$('#planning_to_modify_eq5d').hide();
$("#00N1r00000HHVAN").unbind();
$("input:radio[name=00N1r00000HHVAN]").change(function () {
if (this.value === "1"){
$('#00N1r00000HHVAN-other').show();
// if ($('#regtype').val() == '1') {
// $('#planning_to_modify_eq5d').show();
// }
$('#planning_to_modify_eq5d').show();
$('#00N1r00000HHVAE').addClass('required');
}
else
{
$('#00N1r00000HHVAN-other').hide();
// if ($('#regtype').val() == '1') {
// $('#planning_to_modify_eq5d').hide();
// }
$('#planning_to_modify_eq5d').hide();
//$('#00N1r00000HHVAE').removeClass('required');
var a = document.getElementById("00N1r00000HHVAE");
a.classList.remove("required");
a.classList.remove("user-error");
a.removeAttribute("required");
}
});
// nested dependency between level, mode, country and lang
// definition stored in google spreadsheet
var url = "https://access.euroqol.org/api/v1/products";
var params = [];
var languagesForCountries = {};
var modesForLevels = {};
var languagesAndModesAvailable = [];
var languagesAndModesId = [];
// product (level), mode, country, lang
var modeDevices = new Object(); // or var map = {};
$.getJSON(url, function(data) {
var entry = data;
var i = 0;
$(entry).each(function() {
if(i++ == 0){
return;
}
var row = {};
var level = row['level']=this.level;
row['platform']=this.platform;
row['device']= (!this.device) ? '' : this.device;
var mode = row['mode']=this.mode + ' - ' + row['platform'];
if (row['device']+'' !== ''){
row['mode'] += ' - ' + row['device'] + '';
modeDevices[level + " " + mode] = row['device'];
}else{
modeDevices[level + " " + mode] = 'Paper';
}
var country = row['country'] = this.country;
var language = row['lang'] = this.language + ' (' + country + ')';
languagesAndModesAvailable[language + "|" + level + " " + row['mode']] = true;
languagesAndModesId[language + "|" + level + " " + row['mode']] = this.id;
params.push(row);
if (!languagesForCountries[country]) {
languagesForCountries[country] = [];
}
if (languagesForCountries[country].indexOf(language) === -1) {
languagesForCountries[country].push(language);
}
languagesForCountries[country].sort()
if (!modesForLevels[level]) {
modesForLevels[level] = [];
}
if (modesForLevels[level].indexOf(row['mode']) === -1) {
modesForLevels[level].push(row['mode']);
}
modesForLevels[level].sort( function(a, b){
return getModeOrder(a) - getModeOrder(b);
})
});
var results = {};
var uniqueCountries = [];
for (var i=0; i < params.length; i++) {
var row = params[i];
if (results[row['level']] === undefined) results[row['level']] = {};
if (results[row['level']][row['mode']] === undefined) results[row['level']][row['mode']] = {};
if (results[row['level']][row['mode']][row['country']] === undefined) results[row['level']][row['mode']][row['country']] = [];
results[row['level']][row['mode']][row['country']].push(row['lang']);;
$.each(results[row['level']][row['mode']][row['country']], function(i, el){
if($.inArray(el, uniqueCountries) === -1) uniqueCountries.push(el);
results[row['level']][row['mode']][row['country']] = uniqueCountries;
});
}
function getModeOrder(mode) {
var order = 0;
// switch (mode) {
// case "Self complete - Paper" : order = 1; break;
// case "Self complete - Digital - PDA" : order = 2; break;
// case "Self complete - Digital - Tablet" : order = 3; break;
// case "Self complete - Digital - Laptop/Desktop" : order = 4; break;
// case "Self complete - RedCap - Laptop/Desktop" : order = 5; break;
// case "Self complete - RedCap - Tablet" : order = 6; break;
// case "Facetoface - Paper" : order = 7; break;
// case "Telephone - Paper" : order = 8; break;
// case "Proxy1 - Digital - Tablet" : order = 9; break;
// case "Proxy2 - Digital - Tablet" : order = 10; break;
// case "Proxy1 - Paper" : order = 11; break;
// case "Proxy2 - Paper" : order = 12; break;
// default: order = 0; break;
// }
if (mode.indexOf("Digital")!== -1) {
order = 2;
} else {
order = 1;
}
return order;
}
productsSelected = $(document.getElementById("products_selected"));
var modeSelect = document.getElementById("xxx");
var countrySelect = document.getElementById("countrySelect");
// for (var level in results) {
// levelSelect.options[levelSelect.options.length] = new Option(level, level);
// }
// levelSelect.onchange = function () {
// }
// levelSelect.onchange(); // reset in case page is reloaded
// modeSelect.onchange = function () {
// }
var countrySelection = $(countrySelect);
var keys = Object.keys(languagesForCountries).sort();
for(var i = 0 ; i < keys.length; i++) {
var country = keys[i];
var countryGroup = $("");
var addedAny = false;
var lfc = languagesForCountries[country];
for (var vv = 0; vv < lfc.length; vv++) {
addedAny = true;
$("").appendTo(countryGroup);
}
if (addedAny) {
countryGroup.appendTo(countrySelection);
}
}
countrySelection.multiSelect();
var multiselectSearch = function(searchSelector, multiselectSelector ) {
var multiSelectField = $(multiselectSelector);
//var toShow = multiSelectField.find("li.ms-elem-selectable:containsIN('###')");
$( searchSelector ).keyup(function() {
var input = $(this);
var searchString = input.val();
/*if (searchString.toUpperCase() === 'UNITED STATES' || searchString.toUpperCase() === 'AMERICA' || searchString.toUpperCase() === 'UNITED STATES OF' || searchString.toUpperCase() === 'UNITED STATES OF AMERICA') {
searchString = 'usa';
} else if (searchString.toUpperCase() === 'UNITED KINGDOM' || searchString.toUpperCase() === 'GREAT BRITAIN' || searchString.toUpperCase() === 'ENGLAND') {
searchString = 'uk';
} else if (searchString.toUpperCase() === 'UNITED ARAB' || searchString.toUpperCase() === 'UNITED ARAB EMIRATES') {
searchString = 'uae';
}*/
var toHide = multiSelectField.find("li.ms-elem-selectable:not(:containsIN('" + searchString + "'))");//.closest("li.ms-elem-selectable");
var toHideSelected = multiSelectField.find("li.ms-elem-selection.ms-selected").map(function() { return $(this).attr('id').split('-select')[0]; });
$(toHideSelected).each(function(i, v) {
var toHide2 = multiSelectField.find("li.ms-elem-selectable[id*='" + v + "']")[0];
if(toHide2 != undefined){
toHide.push(toHide2);
}
})
var toShow = multiSelectField.find("li.ms-elem-selectable:containsIN('" + searchString + "')");//.closest("li.ms-elem-selectable");
var groupsToHide = multiSelectField.find("li.ms-optgroup-container[id*='optgroup-selectable']");
var groupsToShow = toShow.closest("li.ms-optgroup-container[id*='optgroup-selectable']");
groupsToHide.hide();
groupsToShow.show();
toShow.show();
toHide.hide();
if (searchSelector == '#modesSelectSearch') {
if ($('#regtype').val() == '1') {
var toHide2 = multiSelectField.find("li.ms-elem-selectable:containsIN('" + 'redcap' + "')");
var toHide3 = multiSelectField.find("li.ms-elem-selectable:containsIN('" + 'qualtrics' + "')");
toHide2.hide();
toHide3.hide();
}
}
});
}
multiselectSearch("#countrySelectSearch", '#ms-countrySelect');
var modesSelection = $(modeSelect);
for(var level in modesForLevels) {
var levelGroup = $("");
var addedAny = false;
var lfc = modesForLevels[level];
for (var vv = 0; vv < lfc.length; vv++) {
addedAny = true;
$("").appendTo(levelGroup);
}
if (addedAny) {
levelGroup.appendTo(modesSelection);
}
}
modesSelection.multiSelect();
multiselectSearch("#modesSelectSearch", '#ms-xxx');
modeSelect.onchange = function (e) {
//var elems = $('#modes_row').find("tr:last th").slice(0);
var change = detectChange(selectedModes, modesSelection);
if (change.add) {
addMode(change.index, change.value);
} else {
removeMode(change.index);
}
}
countrySelect.onchange = function (e) {
//var elems = $('#languages_column').find("tr td:first-child").slice(0);
//var elems = $('#languages_column').find("tr td:first-child").slice(0);
var change = detectChange(selectedLanguages, countrySelection);
if (change.add) {
addLanguage(change.index, change.value, false);
} else {
removeLanguage(change.index);
}
}
var detectChange = function(elements, options) {
var result = {index: 0, value: "", add: true};
//var htmlElements = $(htmlSelector);
var selectedOptions = options.find('option:selected').map(function(){return $(this).attr("value");}).get();
elements = $(elements).map(function(){return $(this).attr("value");}).get();
result.add = selectedOptions.length > elements.length;
var elemsArray = result.add ? selectedOptions : elements;
for (var k = 0; k < elemsArray.length; k++) {
result.index = k;
result.value = selectedOptions[k];
if (elements[k] != selectedOptions[k]) {
break;
}
}
return result;
}
});
var addOtherCountry = function() {
var otherCountry = $(".otherCountryLanguages:last");
var clone = otherCountry.clone();
clone.find('.otherCountries') .val('');
clone.find('.otherLanguages') .val('');
otherCountry.find('#addOtherCountryButton').remove();
clone.insertAfter(otherCountry);
}
var addOtherModesOfAdministration = function() {
var otherCountry = $(".otherModesOfAdministration:last");
var clone = otherCountry.clone();
clone.val('');
clone.insertAfter(otherCountry);
}
var dateOfAvailability = null;
function saveDateOfAvailability(){
dateOfAvailability = document.getElementById('dateOfAvailability').value;
}
function loadDateOfAvailability(){
document.getElementById('dateOfAvailability').value = dateOfAvailability;
}