Just wondering if anyone can help with making all the fields on my contact form a required field. I have added the coding for the contact form php.
Also will there be an adjustment to the coding for the website?
Thank you in advance for your help.
<?php
$field_name = $_POST['cf_name'];
$field_email = $_POST['cf_email'];
$field_phone = $_POST['cf_phone'];
$field_message = $_POST['cf_message'];
$mail_status = mail($mail_to, $subject, $body_message, $headers);
if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message');
window.location = 'index.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email');
window.location = 'index.html';
</script>
<?php
}
?>