I just finished a quick project where the client wanted a HTML form that he could host locally on his PC. The form was to be filled out often, and upon submitting, the contents are emailed to the desired representative in the field. Sound easy? Leaving a blank mailto won’t work.
if(document.pressed == ‘Email‘)
var email = prompt(“Please enter the email the form will be submitted to:”);
var toemail = “mailto:’” + email + “‘”;
document.emailform.action = (toemail);
<form name=”emailform” onSubmit=”return OnSubmitForm();” method=”post” enctype=”text/plain”>
<Misc Text Fields>
<input type=”submit” onClick=”document.pressed=this.value” VALUE=”Email” />
If you are having a problem getting this to work, look how I color coded. You may just be missing or not identifying elements correctly.