I'm trying to get a value from my html file for my phpmailer email but keep getting an unidentified index error.
the html for it is:
<label for="signature"></label>
<input type="text" placeholder="Signature:" name="signature" id ="signature" class="amatic">
<button type="button" id = "info" onclick="changeFont()">Confirm Signature</button>
The js associated with it is:
<script>
function changeFont() {
var fon = document.getElementById("signature");
if (fon.className == "amatic") {
fon.className = 'roman';
} else {
fon.className = 'amatic';
}
}
</script>
<script type="text/javascript">
$(function(){
$('#info').click(function() {
$(this).hide();
signature.disabled = true;
});
});
</script>
So basically, when the user confirms their signature the font will change to a signature style and they can no longer edit that field.
When I try to call the value in Php for the email body by doing:
Signature: {$_POST['signature']}
I get the unidentified index error. Now it works when I get rid of the class, so my question how do I get the value for my email with the class associated with it?
I tried {$_POST['signature.roman']}
but get an error with that as well. I've tried researching it but can't seem to find anything
Hope that makes sense, thanks in advance
Edit: The html is part of a form as so:
When they finish the form and hit submit at the bottom of that page application.php runs.
The rest of the email sends which is why I'm confused as to why I get the error with the signature id, unless I'm missing something completely obvious?
Edit: php code now deleted