var wmform_191683 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,aanmelden_spreekuur: null,bevestiging: null}; with(scope) { aanmelden_spreekuur = (function() { var scope = {uw_naam: null,straat: null,postcode_en_plaats: null,uw_telefoonnummer: null,wanneer_bent_u_het_beste_telefonisch_bereikbaar: null,uw_mailadres: null,bsn_nummer: null,geboortedatum: null,wat_is_de_reden_voor_uw_aanmelding: null,verstuur: null, checkConditions: null, visible: true, validate: null,required_validator: null,number_validator: null,number_range_validator: null,email_validator: null,date_validator: null}; with(scope) { uw_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":"uw_naam"}, {"MISSING":"Dit veld is verplicht"} ); 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 = {}; 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 = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); uw_telefoonnummer = (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":"uw_telefoonnummer"}, {"INVALID_NUMBER":"Vul a.u.b. een getal in"} ); number_range_validator( {"fragment":"uw_telefoonnummer","minimumValue":"null","maximumValue":"null"}, {"NUMBER_OUT_OF_RANGE":"Het ingevulde getal is te klein of te groot"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); wanneer_bent_u_het_beste_telefonisch_bereikbaar = (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; })(); uw_mailadres = (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":"uw_mailadres"}, {"MISSING":"Dit veld is verplicht"} ); email_validator( {"fragment":"uw_mailadres"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); 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 = {}; required_validator( {"fragment":"bsn_nummer"}, {"MISSING":"Dit veld is verplicht"} ); number_validator( {"fragment":"bsn_nummer"}, {"INVALID_NUMBER":"Vul a.u.b. een getal in"} ); number_range_validator( {"fragment":"bsn_nummer","minimumValue":"null","maximumValue":"null"}, {"NUMBER_OUT_OF_RANGE":"Het ingevulde getal is te klein of te groot"} ); 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; })(); wat_is_de_reden_voor_uw_aanmelding = (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":"wat_is_de_reden_voor_uw_aanmelding"}, {"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_191683.required_validator(this, parameters, languageLabels); } number_validator = function(parameters, languageLabels) { return ag_191683.number_validator(this, parameters, languageLabels); } number_range_validator = function(parameters, languageLabels) { return ag_191683.number_range_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_191683.email_validator(this, parameters, languageLabels); } date_validator = function(parameters, languageLabels) { return ag_191683.date_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return aanmelden_spreekuur; }; 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_191683'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_191683']) { WebmanagerFormStateRegistry['wmform_191683'] = wmform_191683; }; }; ag_191683 = new Object(); ag_191683.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_191683.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_191683.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"]; } } } } ag_191683.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_191683.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"]; } } }