var wmform_119308 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,wmstep_1: null}; with(scope) { wmstep_1 = (function() { var scope = {inschrijfformulier_babymassage: null,step_1_input_2: null,voorkeurlocatie: null,versturen: null, checkConditions: null, visible: true, validate: null,required_validator: null}; with(scope) { inschrijfformulier_babymassage = (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; })(); step_1_input_2 = (function() { var scope = {voornaam_en_voorletters: null,achternaam: null,geboortedatum: null,straat: null,uisnummer: null,ostcode: null,woonplaats: null,telefoonnummer: null,mobiel: null,emailadres: null,op_welke_datum_ben_je_uitgerekend: null,bijzonderheden: null, checkConditions: null, visible: true, validate: null,required_validator: null,date_validator: null,email_validator: null}; with(scope) { voornaam_en_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":"voornaam_en_voorletters"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); achternaam = (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":"achternaam"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); geboortedatum = (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":"geboortedatum"}, {"MISSING":"Dit veld is verplicht"} ); date_validator( {"fragment":"geboortedatum"}, {"ILLEGAL_DATE":"Dit is geen geldige datum"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); straat = (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":"straat"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); uisnummer = (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":"uisnummer"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); ostcode = (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":"ostcode"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); woonplaats = (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":"woonplaats"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoonnummer = (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"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); mobiel = (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; })(); 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; })(); op_welke_datum_ben_je_uitgerekend = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; date_validator( {"fragment":"op_welke_datum_ben_je_uitgerekend"}, {"ILLEGAL_DATE":"Dit is geen geldige datum"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); bijzonderheden = (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_119308.required_validator(this, parameters, languageLabels); } date_validator = function(parameters, languageLabels) { return ag_119308.date_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_119308.email_validator(this, parameters, languageLabels); } } return scope; })(); voorkeurlocatie = (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":"voorkeurlocatie"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); versturen = (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_119308.required_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return wmstep_1; }; 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_119308'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_119308']) { WebmanagerFormStateRegistry['wmform_119308'] = wmform_119308; }; }; ag_119308 = new Object(); ag_119308.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_119308.date_validator = function(scope,parameters, languageLabels) { var dateValue = scope[parameters.fragment].value; if (dateValue != undefined && dateValue != "") { dateValue = dateValue.replace(/-/gi, '/'); splitted = dateValue.split('/'); if (splitted.length == 3) { dd = splitted[0]; mm = splitted[1]; yyyy = splitted[2]; var d = new Date(mm + "/" + dd + "/" + yyyy); isDate = (d.getMonth() + 1 == mm && d.getDate() == dd && d.getFullYear() == yyyy); if (!isDate) { scope[parameters.fragment].errors["ILLEGAL_DATE"] = languageLabels["ILLEGAL_DATE"]; } } else { scope[parameters.fragment].errors["ILLEGAL_DATE"] = languageLabels["ILLEGAL_DATE"]; } } } ag_119308.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"]; } }