I have two radio buttons in my contact form like this:
<div class="field form-inline radio">
<input class="radio" type="radio" name="response" value="ATTENDING" /><span>Blalala 1</span>
</div>
<div class="field form-inline radio">
<input class="radio" type="radio" name="response" value="NOT ATTENDING" /><span>Blablabla 2</span>
</div>
/* ... */
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Name</label>
<input type="text" class="form-control" placeholder="Name" id="name" required data-validation-required-message="Write your name">
<p class="help-block text-danger"></p>
</div>
and then some generic contact_me.php from the internet like this:
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
$phone = $_POST['phone'];
$response = $_POST['response'];
/* ... */
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nResponse: $response\n\nMessage:\n$message";
/* ... */
But the response-field remains empty always in the email I get, whatever try. I google a lot, nothing helped. I hope you can!
The rest of the code is from template and it works, two radio buttons I added and cannot get to work.