var wmform_251779 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,aanmelden: null,verzonden: null}; with(scope) { aanmelden = (function() { var scope = {aanmeldformulier_zorgnet_wuzzi_personenaarmering_en_medicijnenspenser: null,ik_meld_me_aan_voor: null,geslacht: null,geboortedatum: null,voorletters: null,achternaam: null,straat: null,huisnummer: null,postode: null,woonplaats: null,telefonnummer_overdag: null,telefoonnummer_aond: null,email: null,bent_u_lid_van_ledenvereniging_thebe_extra: null,ruimte_voor_opmerkingen: null,versturen: null, checkConditions: null, visible: true, validate: null,required_validator: null,date_validator: null,phonenumber_validator: null,email_validator: null}; with(scope) { aanmeldformulier_zorgnet_wuzzi_personenaarmering_en_medicijnenspenser = (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; })(); ik_meld_me_aan_voor = (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":"ik_meld_me_aan_voor"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); geslacht = (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":"geslacht"}, {"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; })(); 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; })(); 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; })(); 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; })(); huisnummer = (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":"huisnummer"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); postode = (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":"postode"}, {"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; })(); telefonnummer_overdag = (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":"telefonnummer_overdag"}, {"MISSING":"Dit veld is verplicht"} ); phonenumber_validator( {"fragment":"telefonnummer_overdag"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); phonenumber_validator( {"fragment":"telefonnummer_overdag"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoonnummer_aond = (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_aond"}, {"MISSING":"Dit veld is verplicht"} ); phonenumber_validator( {"fragment":"telefoonnummer_aond"}, {"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 = {}; email_validator( {"fragment":"email"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); 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; })(); 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; })(); ruimte_voor_opmerkingen = (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; })(); 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_251779.required_validator(this, parameters, languageLabels); } date_validator = function(parameters, languageLabels) { return ag_251779.date_validator(this, parameters, languageLabels); } phonenumber_validator = function(parameters, languageLabels) { return ag_251779.phonenumber_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_251779.email_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return aanmelden; }; 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_251779'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_251779']) { WebmanagerFormStateRegistry['wmform_251779'] = wmform_251779; }; }; ag_251779 = new Object(); ag_251779.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_251779.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_251779.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_251779.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"]; } }