testform

[et_pb_section fb_built=”1″ _builder_version=”4.10.2″ _module_preset=”default” global_colors_info=”{}”][et_pb_row _builder_version=”4.6.1″ _module_preset=”default” global_colors_info=”{}”][et_pb_column type=”4_4″ _builder_version=”4.6.1″ _module_preset=”default” global_colors_info=”{}”][et_pb_contact_form captcha=”off” email=”” custom_message=”from %%name%%||et_pb_line_break_holder||%%Email%%||et_pb_line_break_holder||%%Message%%” module_id=”contact_form” _builder_version=”4.10.8″ _module_preset=”default” hover_enabled=”0″ global_colors_info=”{}” sticky_enabled=”0″][et_pb_contact_field field_id=”vorname” field_title=”Vorname” _builder_version=”4.10.8″ hover_enabled=”0″ global_colors_info=”{}” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”off” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”off” button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”off” button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”off” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off” sticky_enabled=”0″][/et_pb_contact_field][et_pb_contact_field fullwidth_field=”on” _builder_version=”4.10.8″ _module_preset=”default” field_id=”nachname” field_title=”Nachname” hover_enabled=”0″ sticky_enabled=”0″][/et_pb_contact_field][et_pb_contact_field field_id=”contact_email” field_title=”E-Mail-Adresse” field_type=”email” _builder_version=”4.10.8″ global_colors_info=”{}” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”off” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”off” button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”off” button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”off” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off”][/et_pb_contact_field][et_pb_contact_field field_id=”Message” field_title=”Nachricht” field_type=”text” fullwidth_field=”on” _builder_version=”3.16″ global_colors_info=”{}” button_text_size__hover_enabled=”off” button_one_text_size__hover_enabled=”off” button_two_text_size__hover_enabled=”off” button_text_color__hover_enabled=”off” button_one_text_color__hover_enabled=”off” button_two_text_color__hover_enabled=”off” button_border_width__hover_enabled=”off” button_one_border_width__hover_enabled=”off” button_two_border_width__hover_enabled=”off” button_border_color__hover_enabled=”off” button_one_border_color__hover_enabled=”off” button_two_border_color__hover_enabled=”off” button_border_radius__hover_enabled=”off” button_one_border_radius__hover_enabled=”off” button_two_border_radius__hover_enabled=”off” button_letter_spacing__hover_enabled=”off” button_one_letter_spacing__hover_enabled=”off” button_two_letter_spacing__hover_enabled=”off” button_bg_color__hover_enabled=”off” button_one_bg_color__hover_enabled=”off” button_two_bg_color__hover_enabled=”off”][/et_pb_contact_field][/et_pb_contact_form][et_pb_code _builder_version=”4.10.8″ _module_preset=”default” global_colors_info=”{}”]jQuery(document).ready(function() { jQuery(‘.et_pb_contact_form’).bind(‘submit’, send_form); function send_form(e) { e.preventDefault(); var myform = jQuery(this).parents(‘form’); var post_data = myform.serialize(); var script = ‘/wp-content/themes/DiviChild/processForm.php’; jQuery.post(script, post_data, function(data) { var resp = jQuery.parseJSON(data); $(‘#report-success’).html(”); $(‘#report-error’).html(”); if (resp.status == “success”) { jQuery(‘#report-success’).html(resp.msg); } else jQuery(‘#report-error’).html(resp.msg); }); } });[/et_pb_code][et_pb_text _builder_version=”4.10.8″ _module_preset=”default” global_colors_info=”{}”]

<script>
jQuery(document).ready(function() {

jQuery(‘.et_pb_contact_form’).bind(‘submit’, sendForm);

function sendForm(e) {
e.preventDefault(); // wir rufen die Funktion send_credentials auf
var myform = $(this).parents(‘form’);
var post_data = myform.serialize();
var script = ‘https://hebamme-friedrichsdorf.de/wp-content/themes/DiviChild/processForm.php’;

$.post(script, post_data, function(data) {
var resp = jQuery.parseJSON(data);
$(‘#report-success’).html(”);
$(‘#report-error’).html(”);
if (resp.status == “success”) {
$(‘#report-success’).html(resp.msg);
}
else
$(‘#report-error’).html(resp.msg);
});

}

function checkForm(e){

<!– $empfaenger = ‘’;
$betreff = ‘Kontaktformular’;
$nachricht = jQuery(‘#et_pb_contact_message_0’,this).val();
$header = ‘From: ‘ . jQuery(‘#et_pb_contact_name_0’,this).val() .'<‘.jQuery(‘#et_pb_contact_email_0′,this).val().’>’. “\r\n” .
‘Reply-To: ‘ .jQuery(‘#et_pb_contact_name_0’,this).val() .'<‘.jQuery(‘#et_pb_contact_email_0′,this).val().’>’. “\r\n” .
‘X-Mailer: PHP/’ . phpversion();
mail($empfaenger, $betreff, $nachricht, $header);
–>

var check = checkKV(jQuery(‘#et_pb_contact_name_0’,this).val());
if (!check) {
jQuery(‘#et_pb_contact_name_0’).addClass(‘et_contact_error’);
jQuery(‘.et-pb-contact-message’).append(‘<p>Ungültige Versicherungsnummer!</p>’)
e.preventDefault();
e.stopImmediatePropagation();
}
}

function checkKV(kvnummer) {
var re = new RegExp(“^([a-z][0-9]{9})$”);
kvnummer = kvnummer.toLowerCase();
if (re.test(kvnummer)) {
var kvcode = (kvnummer.charCodeAt(0) – 96).pad(2) + kvnummer.substring(1, 9);
return checkLuhn(kvcode) == kvnummer.substring(9);
} else {
return false;
}
}

Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = “0” + s;}
return s;
}

function checkLuhn(code) {
if (Number.isNaN(code)) return ”;
var len = code.length;
var sum = 0;
for (var i = 0 ; i < len; i++) {
var d = parseInt(code.charAt(i));
if (i % 2) { d *= 2 }
if (d > 9) { d -= 9 }
sum += d;
}
return (sum % 10).toString();
}

function checkLuhnSave(code) {
if (Number.isNaN(code)) return ”;
var len = code.length;
var parity = len % 2;
var sum = 0;
for (var i = len-1; i >= 0; i–) {
var d = parseInt(code.charAt(i));
if (i % 2 == parity) { d *= 2 }
if (d > 9) { d -= 9 }
sum += d;
}
return (sum % 10).toString();
}

});
</script>

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]