var wmform_190992 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,persoonlijke_gegevens: null,abonnementskeuze_sub: null,gezondheid: null,gezondheid_2: null,gezondheid3: null,invulen: null}; with(scope) { persoonlijke_gegevens = (function() { var scope = {naam_en_voorletters: null,naam__voorletters: null,dhr_mevr: null,voorletters: null,geboortedatum: null,bsn_nummer: null,adres: null,postcode_en_plaats: null,plaats: null,woningtype: null,telefoonnummer_pers: null,email: null,heeft_u_een_partner: null,wmfragment_11: null,naam_en_voorletters_eventuele_partner: null,dhr_mevr_partner: null,naam_huisarts: null,telefoonummer_huisarts: null,iban_bankrekeningnummer: null,bent_u_lid_van_ledenvereniging_thebe_extra: null,wmfragment_14: null,thebe_lidmaatschapsnummer: null,lid: null,contactpersoon_voor_deze_aanvraag: null,telefoon_contactpersoon: null,email_contactpersoon: null,verder_pers: null, checkConditions: null, visible: true, validate: null,required_validator: null,bsn_validator: null,phonenumber_validator: null,email_validator: null,number_validator: null,number_range_validator: null}; with(scope) { naam_en_voorletters = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); naam__voorletters = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"naam__voorletters"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); dhr_mevr = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"dhr_mevr"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); voorletters = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); geboortedatum = (function() { var scope = {value: 'dd-mm-jjjj', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = 'dd-mm-jjjj'; validate = function() { this.errors = {}; required_validator( {"fragment":"geboortedatum"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); bsn_nummer = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; bsn_validator( {"fragment":"bsn_nummer"}, {"INVALID_BSN":"Onjuist burger service nummer (BSN)"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); adres = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"adres"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); postcode_en_plaats = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"postcode_en_plaats"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); plaats = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"plaats"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); woningtype = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"woningtype"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoonnummer_pers = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"telefoonnummer_pers"}, {"MISSING":"Dit veld is verplicht"} ); phonenumber_validator( {"fragment":"telefoonnummer_pers"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); email = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"email"}, {"MISSING":"Dit veld is verplicht"} ); email_validator( {"fragment":"email"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); heeft_u_een_partner = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"heeft_u_een_partner"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); wmfragment_11 = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); naam_en_voorletters_eventuele_partner = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { var oldVisible = visible; this.visible = ((persoonlijke_gegevens.heeft_u_een_partner.condition && (!(persoonlijke_gegevens.heeft_u_een_partner.value instanceof Array) && persoonlijke_gegevens.heeft_u_een_partner.value == 'ja' || (persoonlijke_gegevens.heeft_u_een_partner.value instanceof Array) && persoonlijke_gegevens.heeft_u_een_partner.value.indexOf('ja') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); dhr_mevr_partner = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { var oldVisible = visible; this.visible = ((persoonlijke_gegevens.heeft_u_een_partner.condition && (!(persoonlijke_gegevens.heeft_u_een_partner.value instanceof Array) && persoonlijke_gegevens.heeft_u_een_partner.value == 'ja' || (persoonlijke_gegevens.heeft_u_een_partner.value instanceof Array) && persoonlijke_gegevens.heeft_u_een_partner.value.indexOf('ja') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); naam_huisarts = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoonummer_huisarts = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; phonenumber_validator( {"fragment":"telefoonummer_huisarts"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); iban_bankrekeningnummer = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); bent_u_lid_van_ledenvereniging_thebe_extra = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; required_validator( {"fragment":"bent_u_lid_van_ledenvereniging_thebe_extra"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); wmfragment_14 = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); thebe_lidmaatschapsnummer = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; number_validator( {"fragment":"thebe_lidmaatschapsnummer"}, {"INVALID_NUMBER":"Vul a.u.b. een getal in"} ); number_range_validator( {"fragment":"thebe_lidmaatschapsnummer","minimumValue":"null","maximumValue":"null"}, {"NUMBER_OUT_OF_RANGE":"Het ingevulde getal is te klein of te groot"} ); return this.errors; }; checkConditions = function() { var oldVisible = visible; this.visible = ((persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.condition && (!(persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value instanceof Array) && persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value == 'ja' || (persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value instanceof Array) && persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value.indexOf('ja') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); lid = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { var oldVisible = visible; this.visible = ((persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.condition && (!(persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value instanceof Array) && persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value == 'ja' || (persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value instanceof Array) && persoonlijke_gegevens.bent_u_lid_van_ledenvereniging_thebe_extra.value.indexOf('ja') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); contactpersoon_voor_deze_aanvraag = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoon_contactpersoon = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; phonenumber_validator( {"fragment":"telefoon_contactpersoon"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); email_contactpersoon = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; email_validator( {"fragment":"email_contactpersoon"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); verder_pers = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); required_validator = function(parameters, languageLabels) { return ag_190992.required_validator(this, parameters, languageLabels); } bsn_validator = function(parameters, languageLabels) { return ag_190992.bsn_validator(this, parameters, languageLabels); } phonenumber_validator = function(parameters, languageLabels) { return ag_190992.phonenumber_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_190992.email_validator(this, parameters, languageLabels); } number_validator = function(parameters, languageLabels) { return ag_190992.number_validator(this, parameters, languageLabels); } number_range_validator = function(parameters, languageLabels) { return ag_190992.number_range_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return persoonlijke_gegevens; }; validateAndReturnMessage = function(inputName,value) { var fragmentObj = getObject(currentStep(),inputName); if (fragmentObj != null) { fragmentObj.value = value; return fragmentObj.validate(); } }; getObject = function(obj, expression) { if (typeof obj != 'undefined' && obj != null) { var index = expression.indexOf('.'); if (index == -1) { return obj[expression]; } else { return getObject(obj[expression.substring(0,index)],expression.substring(index+1, expression.length)); } } else { return null; } } } return scope; })(); if (typeof WebmanagerFormStateRegistry != 'undefined') { if (typeof WebmanagerFormStateRegistry['wmform_190992'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_190992']) { WebmanagerFormStateRegistry['wmform_190992'] = wmform_190992; }; }; ag_190992 = new Object(); ag_190992.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_190992.bsn_validator = function(scope,parameters, languageLabels) { // retrieve BSN value var bsn = scope[parameters.fragment].value; // check whether it is not empty if (bsn==undefined || bsn=="" || (typeof(bsn.trim)=="function" && bsn.trim()=="")) { // that's fine; scope case should be handled by the required validator return; } // remove all gibberish bsn = bsn.replace(/\./gi, ''); // remove all dots bsn = bsn.replace(/\s/gi, ''); // remove all whitespace bsn = bsn.replace(/,/gi, ''); // remove all commas // check for any non numeric values; they should not be here! if (bsn.match(/[^0-9]/)) { scope[parameters.fragment].errors["INVALID_BSN"] = languageLabels["INVALID_BSN"]; return; } // check the length; it should always be 9 if (bsn.length==8) { bsn = "0" + bsn; } else if (bsn.length!=9) { scope[parameters.fragment].errors["INVALID_BSN"] = languageLabels["INVALID_BSN"]; return; } var total = 0; for(i=0; i<9; i++) { var digit = parseInt(bsn.substring(i, i+1)); if (i<8) { total += digit * (9-i); } else { // In the BSN elfcheck, the last number is a control number - subtract it instead of adding it total -= digit * (9-i); } } if (total%11 == 0) { scope[parameters.fragment].value = bsn; return; } scope[parameters.fragment].errors["INVALID_BSN"] = languageLabels["INVALID_BSN"]; return; } ag_190992.phonenumber_validator = function(scope,parameters, languageLabels) { // retrieve the phonenumber value var phonenumber = scope[parameters.fragment].value; // check whether it is not empty if (phonenumber==undefined || phonenumber=="" || (typeof(phonenumber.trim)=="function" && phonenumber.trim()=="")) { // scope is fine; should be handled by the required validator return; } // remove all gibberish phonenumber = phonenumber.replace(/\s/gi, ''); // remove all whitespace phonenumber = phonenumber.replace(/^\+/gi, '00'); // replace leading + with 00 phonenumber = phonenumber.replace(/\-/gi, ''); // strip the dashes // check for any non numeric values; they should not be here (anymore)! // check for a leading zero in the number; which is mandatory if (!phonenumber.match(/^0[0-9]+$/)) { scope[parameters.fragment].errors["INVALID_PHONENUMBER"] = languageLabels["INVALID_PHONENUMBER"]; return; } // check whether we're dealing with an number with a leading international access code if (phonenumber.match(/^00/)) { // phone number starts with international access prefix if (!phonenumber.match(/^0031/)) { // but it is not the dutch one. we let scope one through scope[parameters.fragment].value = phonenumber; return; } else { // it's a dutch one - strip off the international access code phonenumber = phonenumber.replace(/^0031/gi, '0'); } } if (phonenumber.length==10) { // all dutch phonenumbers have 10 digits so scope one is ok! scope[parameters.fragment].value = phonenumber; return; } scope[parameters.fragment].errors["INVALID_PHONENUMBER"] = languageLabels["INVALID_PHONENUMBER"]; return; } ag_190992.email_validator = function(scope,parameters, languageLabels) { var myExpression = /^[a-zA-Z0-9][\w\.\-+]*@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/; if (scope[parameters.fragment].value != undefined && scope[parameters.fragment].value != "" && !myExpression.test(scope[parameters.fragment].value)) { scope[parameters.fragment].errors["INVALID_EMAIL"] = languageLabels["INVALID_EMAIL"]; } } ag_190992.number_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value != undefined && scope[parameters.fragment].value !== "") { var value = scope[parameters.fragment].value + ''; if (!value.match(/^-{0,1}[0-9]+\.?[0-9]*$/)) { scope[parameters.fragment].errors["INVALID_NUMBER"] = languageLabels["INVALID_NUMBER"]; } else { scope[parameters.fragment].value = parseFloat(value); } } } ag_190992.number_range_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value != undefined && scope[parameters.fragment].value !== "") { value = scope[parameters.fragment].value; minValue = parseFloat(parameters.minimumValue); maxValue = parseFloat(parameters.maximumValue); if (parameters.minimumValue != '') { if (value < minValue) { scope[parameters.fragment].errors["NUMBER_OUT_OF_RANGE"] = languageLabels["NUMBER_OUT_OF_RANGE"]; } } if (parameters.maximumValue != '') { if (value > maxValue) { scope[parameters.fragment].errors["NUMBER_OUT_OF_RANGE"] = languageLabels["NUMBER_OUT_OF_RANGE"]; } } } }