var wmform_204562 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,gegevens: null,verstuurd: null}; with(scope) { gegevens = (function() { var scope = {vul_hier_je_persoonlijke_gegevens_in_copy: null,personeelsnummer: null,naam: null,emailadres: null,ondersteuning: null,toelichting_keuze_1: null,toelichting_keuze_2: null,toelichting_keuze_3: null,toelichting_verkeerde_module: null,omschrijving: null,verstuur: null, checkConditions: null, visible: true, validate: null,required_validator: null,email_validator: null}; with(scope) { vul_hier_je_persoonlijke_gegevens_in_copy = (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; })(); personeelsnummer = (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":"personeelsnummer"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); naam = (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"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); emailadres = (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":"emailadres"}, {"MISSING":"Dit veld is verplicht"} ); email_validator( {"fragment":"emailadres"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); ondersteuning = (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; })(); toelichting_keuze_1 = (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 = ((gegevens.ondersteuning.condition && (!(gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value == 'Ik kan niet inloggen' || (gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value.indexOf('Ik kan niet inloggen') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); toelichting_keuze_2 = (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 = ((gegevens.ondersteuning.condition && (!(gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value == 'Ik kan de module niet openen' || (gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value.indexOf('Ik kan de module niet openen') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); toelichting_keuze_3 = (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 = ((gegevens.ondersteuning.condition && (!(gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value == 'Ik kan niet meer in de manuals' || (gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value.indexOf('Ik kan niet meer in de manuals') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); toelichting_verkeerde_module = (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 = ((gegevens.ondersteuning.condition && (!(gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value == 'Ik heb de verkeerde module aangevraagd' || (gegevens.ondersteuning.value instanceof Array) && gegevens.ondersteuning.value.indexOf('Ik heb de verkeerde module aangevraagd') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); omschrijving = (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":"omschrijving"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); verstuur = (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_204562.required_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_204562.email_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return 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_204562'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_204562']) { WebmanagerFormStateRegistry['wmform_204562'] = wmform_204562; }; }; ag_204562 = new Object(); ag_204562.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_204562.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"]; } }