var wmform_280393 = (function() { var scope = {validateAndReturnMessage: null, currentStep: null,stap_1: null,stap_2: null,stap_3: null,stap_5: null}; with(scope) { stap_1 = (function() { var scope = {row: null,sectie_1: null,verplicht: null,afkomst: null,intranet_param: null,script: null,intranet: null,naam_medewerker: null,vestiging: null,vestiging_name: null,klant_categorie: null,script_empty_values: null,rij_kvk_nr__kvk_vestigingsnr: null,kvk_nummer: null,kvk_vestigingsnummer: null,uw_bedrijfsgegevens: null,bedrijfsnaam: null,omschrijving_bedrijfsactiviteit: null,adres_gegevens: null,straat: null,huisnummer: null,huisnummer_toevoeging: null,postcode_nummers: null,woonplaats: null,land: null,telefoon: null,wmfragment_4: null,volgende: null,prefill_overruled: null,visitorinfo: null, checkConditions: null, visible: true, validate: null,required_validator: null,kvknumber_validator: null,regexp_validator: null,phonenumber_validator: null}; with(scope) { row = (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; })(); sectie_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; })(); verplicht = (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; })(); afkomst = (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; })(); intranet_param = (function() { var scope = {value: '0', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = '0'; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); script = (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; })(); intranet = (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 = ((stap_1.intranet_param.condition && (!(stap_1.intranet_param.value instanceof Array) && stap_1.intranet_param.value == '1' || (stap_1.intranet_param.value instanceof Array) && stap_1.intranet_param.value.indexOf('1') != -1))); if (oldVisible != visible) { if (!visible) { this.originalvalue = value; value = null; } else { value = this.originalvalue; } } return true; }; } return scope; })(); naam_medewerker = (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; })(); vestiging = (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":"vestiging"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); vestiging_name = (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; })(); klant_categorie = (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":"klant_categorie"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); script_empty_values = (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; })(); rij_kvk_nr__kvk_vestigingsnr = (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; })(); kvk_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":"kvk_nummer"}, {"MISSING":"Dit veld is verplicht"} ); kvknumber_validator( {"fragment":"kvk_nummer"}, {"INVALID_KVKNUMBER":"Onjuist KvK nummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); kvk_vestigingsnummer = (function() { var scope = {value: '', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = ''; validate = function() { this.errors = {}; regexp_validator( {"fragment":"kvk_vestigingsnummer","regexp":"[0-9]{12}"}, {"NOMATCH":"De ingevulde waarde is onjuist"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); uw_bedrijfsgegevens = (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; })(); bedrijfsnaam = (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":"bedrijfsnaam"}, {"MISSING":"Dit veld is verplicht"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); omschrijving_bedrijfsactiviteit = (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; })(); adres_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; })(); 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"} ); required_validator( {"fragment":"huisnummer"}, {"MISSING":"Dit veld is verplicht"} ); regexp_validator( {"fragment":"huisnummer","regexp":"^[1-9]{1}[0-9]{0,4}$"}, {"NOMATCH":"De ingevulde waarde is onjuist"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); huisnummer_toevoeging = (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_nummers = (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_nummers"}, {"MISSING":"Dit veld is verplicht"} ); regexp_validator( {"fragment":"postcode_nummers","regexp":"^[1-9][0-9]{3}\s?[a-zA-Z]{2}$"}, {"NOMATCH":"De ingevulde waarde is onjuist"} ); 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; })(); land = (function() { var scope = {value: 'Nederland', validate: null, errors: {}, visible: true, checkConditions: null, validated: false, condition: true}; with(scope) { originalvalue = 'Nederland'; validate = function() { this.errors = {}; return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); telefoon = (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":"telefoon"}, {"MISSING":"Dit veld is verplicht"} ); phonenumber_validator( {"fragment":"telefoon"}, {"INVALID_PHONENUMBER":"Onjuist telefoonnummer"} ); return this.errors; }; checkConditions = function() { this.visible = true; }; } return scope; })(); wmfragment_4 = (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; })(); volgende = (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; })(); prefill_overruled = (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; })(); visitorinfo = (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_280393.required_validator(this, parameters, languageLabels); } kvknumber_validator = function(parameters, languageLabels) { return ag_280393.kvknumber_validator(this, parameters, languageLabels); } regexp_validator = function(parameters, languageLabels) { return ag_280393.regexp_validator(this, parameters, languageLabels); } phonenumber_validator = function(parameters, languageLabels) { return ag_280393.phonenumber_validator(this, parameters, languageLabels); } } return scope; })(); currentStep = function() { return stap_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_280393'] == 'undefined' || !WebmanagerFormStateRegistry['wmform_280393']) { WebmanagerFormStateRegistry['wmform_280393'] = wmform_280393; }; }; ag_280393 = new Object(); ag_280393.required_validator = function(scope,parameters, languageLabels) { if (scope[parameters.fragment].value == undefined || scope[parameters.fragment].value === "") { scope[parameters.fragment].errors["MISSING"] = languageLabels["MISSING"]; } } ag_280393.kvknumber_validator = function(scope,parameters, languageLabels) { // retrieve kvk number value var kvk = scope[parameters.fragment].value; // check whether it is not empty if (kvk==undefined || kvk=="" || (typeof(kvk.trim)=="function" && kvk.trim()=="")) { // that's fine; scope case should be handled by the required validator return; } // remove all gibberish kvk = kvk.replace(/\./gi, ''); // remove all dots kvk = kvk.replace(/\s/gi, ''); // remove all whitespace if (!kvk.match(/^[0-9]{3}[0-9]{3}[0-9]{2}$/)) { scope[parameters.fragment].errors["INVALID_KVKNUMBER"] = languageLabels["INVALID_KVKNUMBER"]; return; } scope[parameters.fragment].value = kvk; } ag_280393.regexp_validator = function(scope,parameters, languageLabels) { // retrieve the value and the regexp value var val = scope[parameters.fragment].value + ''; var regexp = parameters.regexp; // check whether it is not empty if (val==undefined || val=="" || (typeof(val.trim) == "function" && val.trim()=="")) { // should be handled by the required validator return; } if (!val.match(regexp)) { scope[parameters.fragment].errors["NOMATCH"] = languageLabels["NOMATCH"]; return; } } ag_280393.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; }