var wmform_175919 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,aanmelden: null}; with(scope) { aanmelden = (function() { var scope = {ja_ik_wil_graag_dat_heerlijk_aan_tafelcontact_met_mij_opneemt_voor_het_bezorgen_van_een_gratis_maaltijd: null,naam: null,adres: null,postcode: null,woonplaats: null,emal: null,telefoonnr: null,op_welke_manier_bent_u_bij_ons_terecht_gekomen_via_: null,__frff: null,anders_namelijk_: null,verstuur: null, checkConditions: null, visible: true, validate: null,required_validator: null,email_validator: null,phonenumber_validator: null}; with(scope) { ja_ik_wil_graag_dat_heerlijk_aan_tafelcontact_met_mij_opneemt_voor_het_bezorgen_van_een_gratis_maaltijd = (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":"ja_ik_wil_graag_dat_heerlijk_aan_tafelcontact_met_mij_opneemt_voor_het_bezorgen_van_een_gratis_maaltijd"}, {"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; })(); 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 = (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"}, {"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; })(); emal = (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":"emal"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); email_validator( {"fragment":"emal"}, {"INVALID_EMAIL":"Vul a.u.b. een geldig e-mailadres in"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoonnr = (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":"telefoonnr"}, {"MISSING":"Dit veld is verplicht"} ); phonenumber_validator( {"fragment":"telefoonnr"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); op_welke_manier_bent_u_bij_ons_terecht_gekomen_via_ = (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; })(); __frff = (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; })(); anders_namelijk_ = (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; })(); 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_175919.required_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_175919.email_validator(this, parameters, languageLabels); } phonenumber_validator = function(parameters, languageLabels) { return ag_175919.phonenumber_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_175919'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_175919']) { WebmanagerFormStateRegistry['wmform_175919'] = wmform_175919; }; }; ag_175919 = new Object(); ag_175919.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_175919.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_175919.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; }