'; $cf7Form.find('input[name="_wpcf7"]').parent().append(fname); if(0 === data.length){ $cf7Form.trigger("cf7_2_post_819ebf8e3c", data); return false; } if(data.referrer !== undefined){ $cf7Form.c2pCF7Field("select", "referrer", data.referrer);};if(data.referrer_text !== undefined){ $cf7Form.c2pCF7Field("text", "referrer-text", data.referrer_text);};if(data.datenschutz !== undefined){ $cf7Form.c2pCF7Field("acceptance", "datenschutz", data.datenschutz);}; if(data.map_post_id !== undefined){ fname = ''; $cf7Form.find('input[name="_wpcf7"]').parent().append(fname); } /* trigger the formMapped event to let other scripts that the form is now ready */ if( $cf7Form.is('.cf7-smart-grid .wpcf7-form') && !$cf7Form.is('.cf7sg-ready') ){ $cf7Form.on('cf7SmartGridReady', function(){ $cf7Form.trigger("cf7_2_post_819ebf8e3c", data) }) }else{ $cf7Form.trigger("cf7_2_post_819ebf8e3c", data); } //console.log('cf7_2_post_819ebf8e3c form ready'); }//end preloadForm() }); //document ready //field setter for jquery form object. if(!$.isFunction( $.fn.c2pCF7Field)){ $.fn.c2pCF7Field = function(fieldType, fieldName, fieldValue){ let $form = $(this), $field = null; if(!$form.is('form.wpcf7-form')) return false; if(fieldType === null) fieldType = ''; //do we have a field if(typeof fieldName == 'string' && fieldName.length > 0 ){ let pe = new CustomEvent(`c2p-prefill-field`, { name: fieldName,value: fieldValue }); switch(fieldType){ case 'checkbox': case 'radio': fieldName = 'checkbox'===fieldType ? `${fieldName}[]` : fieldName; if(!Array.isArray(fieldValue)) fieldValue = new Array(fieldValue); $.each(fieldValue , function(index, v){ $field = $form.find(`input[name="${fieldName}"][value="${v}"]`).prop('checked',true).trigger('change'); }); break; case 'select': case 'dynamic_select': $field = $form.find(`select[name=${fieldName}]`).val(fieldValue).trigger("change"); break; case 'textarea': $field = $form.find(`textarea[name=${fieldName}]`).val(fieldValue).trigger("change"); break; case 'file': break; default: $field = $form.find(`input[name="${fieldName}"]`).val(fieldValue).trigger("change"); break; } if($field) $field.get(0).dispatchEvent(pe); } return $form; } }})( jQuery );(function( $ ) { 'use strict'; $( document).ready(function() { var fname; var $cf7Form = $("div#cf7_2_post_dc8e322995 form.wpcf7-form"); var $input; if($cf7Form.is('div.cf7-smart-grid.has-grid form.wpcf7-form')){ //if the smart grid is enabled, execute the loading once the grid is ready $cf7Form.on('cf7SmartGridReady', function(){ preloadForm($(this)); }); }else{ preloadForm($cf7Form); } // function to load all the data into the form function preloadForm($cf7Form){ var data = ''; if('function' == typeof $.fn.post2CF7FormData) data = $cf7Form.post2CF7FormData('cf7_2_post_dc8e322995'); else if( 'undefined' != typeof window['cf7_2_post_dc8e322995'] ) data = window['cf7_2_post_dc8e322995']; fname = ''; $cf7Form.find('input[name="_wpcf7"]').parent().append(fname); if(0 === data.length){ $cf7Form.trigger("cf7_2_post_dc8e322995", data); return false; } if(data.referrer !== undefined){ $cf7Form.c2pCF7Field("select", "referrer", data.referrer);};if(data.referrer_text !== undefined){ $cf7Form.c2pCF7Field("text", "referrer-text", data.referrer_text);};if(data.datenschutz !== undefined){ $cf7Form.c2pCF7Field("acceptance", "datenschutz", data.datenschutz);}; if(data.map_post_id !== undefined){ fname = ''; $cf7Form.find('input[name="_wpcf7"]').parent().append(fname); } /* trigger the formMapped event to let other scripts that the form is now ready */ if( $cf7Form.is('.cf7-smart-grid .wpcf7-form') && !$cf7Form.is('.cf7sg-ready') ){ $cf7Form.on('cf7SmartGridReady', function(){ $cf7Form.trigger("cf7_2_post_dc8e322995", data) }) }else{ $cf7Form.trigger("cf7_2_post_dc8e322995", data); } //console.log('cf7_2_post_dc8e322995 form ready'); }//end preloadForm() }); //document ready //field setter for jquery form object. if(!$.isFunction( $.fn.c2pCF7Field)){ $.fn.c2pCF7Field = function(fieldType, fieldName, fieldValue){ let $form = $(this), $field = null; if(!$form.is('form.wpcf7-form')) return false; if(fieldType === null) fieldType = ''; //do we have a field if(typeof fieldName == 'string' && fieldName.length > 0 ){ let pe = new CustomEvent(`c2p-prefill-field`, { name: fieldName,value: fieldValue }); switch(fieldType){ case 'checkbox': case 'radio': fieldName = 'checkbox'===fieldType ? `${fieldName}[]` : fieldName; if(!Array.isArray(fieldValue)) fieldValue = new Array(fieldValue); $.each(fieldValue , function(index, v){ $field = $form.find(`input[name="${fieldName}"][value="${v}"]`).prop('checked',true).trigger('change'); }); break; case 'select': case 'dynamic_select': $field = $form.find(`select[name=${fieldName}]`).val(fieldValue).trigger("change"); break; case 'textarea': $field = $form.find(`textarea[name=${fieldName}]`).val(fieldValue).trigger("change"); break; case 'file': break; default: $field = $form.find(`input[name="${fieldName}"]`).val(fieldValue).trigger("change"); break; } if($field) $field.get(0).dispatchEvent(pe); } return $form; } }})( jQuery );/* ]]> */
Unsere Website verwendet Cookies und verschiedene Drittanbieter-Inhalte. Bitte wählen Sie nachfolgend aus, welche Dienste Sie zulassen möchten. Weitere Informationen entnehmen Sie bitte unserer Datenschutzerklärung.
Zu dieser Website können durch vorheriges Akzeptieren von Drittanbieterquellen bereits Cookies gesetzt sein.
Nachfolgend können Sie diese aus Ihrem Browser entfernen.
Zusätzlich zu den aufgelisteten Cookies, setzt dieser Datenschutzdialog die Cookies ccSA (Session Cookie) und ccTags (gespeicherte Einstellungen).
Bitte beachten Sie, dass die unten dargestellte Cookie-Liste keine Third-Party-Cookies enthält. Diese können Sie je nach Browser in den jeweiligen Einstellungen nachsehen.