var wmform_120627 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,invulen: null,verstuurd: null}; with(scope) { invulen = (function() { var scope = {contactformulier_thebe: null,uw_gegevens: null,dhrmevr: null,achternaam: null,woonplaats: null,telefoonnummer_1: null,beste_terugbeltijd: null,emailadres: null,voor_wier_is_uw_vraag_bedoeld: null,vraag_voor_ledenvereniging: null,postcode: null,huisnummer: null,stel_hier_uw_vraag: null,versturen: null, checkConditions: null, visible: true, validate: null,required_validator: null,email_validator: null,postalcode_validator: null}; with(scope) { contactformulier_thebe = (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_gegevens = (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; })(); dhrmevr = (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; })(); 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_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() { this.visible = true; }; } return scope; })(); beste_terugbeltijd = (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; })(); voor_wier_is_uw_vraag_bedoeld = (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":"voor_wier_is_uw_vraag_bedoeld"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); vraag_voor_ledenvereniging = (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 = ((invulen.voor_wier_is_uw_vraag_bedoeld.condition && (!(invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value == 'item 8' || (invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value.indexOf('item 8') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } 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"} ); postalcode_validator( {"fragment":"postcode"}, {"INVALID_POSTALCODE":"Onjuiste postcode"} ); return this.errors; }; checkConditions = function() { var oldVisible = visible; this.visible = ((invulen.voor_wier_is_uw_vraag_bedoeld.condition && (!(invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value == 'item 8' || (invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value.indexOf('item 8') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } 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() { var oldVisible = visible; this.visible = ((invulen.voor_wier_is_uw_vraag_bedoeld.condition && (!(invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value == 'item 8' || (invulen.voor_wier_is_uw_vraag_bedoeld.value instanceof Array) && invulen.voor_wier_is_uw_vraag_bedoeld.value.indexOf('item 8') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return (oldVisible != visible); }; } return scope; })(); stel_hier_uw_vraag = (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":"stel_hier_uw_vraag"}, {"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_120627.required_validator(this, parameters, languageLabels); } email_validator = function(parameters, languageLabels) { return ag_120627.email_validator(this, parameters, languageLabels); } postalcode_validator = function(parameters, languageLabels) { return ag_120627.postalcode_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return invulen; }; 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_120627'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_120627']) { WebmanagerFormStateRegistry['wmform_120627'] = wmform_120627; }; }; ag_120627 = new Object(); ag_120627.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_120627.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_120627.postalcode_validator = function(scope,parameters, languageLabels) { // retrieve the postalcode value var postalcode = scope[parameters.fragment].value; // check whether it is not empty if (postalcode==undefined || postalcode=="" || (typeof(postalcode.trim) == "function" && postalcode.trim()=="")) { // should be handled by the required validator return; } // remove all gibberish postalcode = postalcode.replace(/\s/gi, ''); // remove all whitespace postalcode = postalcode.toUpperCase(); if (!postalcode.match(/^[0-9]{4}[A-Z]{2}$/)) { scope[parameters.fragment].errors["INVALID_POSTALCODE"] = languageLabels["INVALID_POSTALCODE"]; return; } scope[parameters.fragment].value = postalcode; }