I'm creating a website and I have to send the text of a form as an email. I'm running the script before the body so as the function is not working is blocking the whole script. The function I use is this:
function Email(){
var command='mailto:blahblah@gmail.com?Subject=';
command=+ document.getElementById('subject').value;
command=+ "&body=";
command=+ document.getElementById('context').value;
window.location.href=command;
}
So basically the user enters in two fields the subject and the message of the email and I want it to be send as an email but it doesn't open the outlook as it does when I use a fixed command.
My HTML code that is used is this:
<button onclick="Email();"> Send </button>
I corrected all the things mentioned to the comments and now I get an error saying:
Firefox can't find the file at /C:/..../NaN. Check the file name for capitalisation or other typing errors. Check to see if the file was moved, renamed or deleted.