如何将JavaScript电子邮件设为表单?

时间:2015-09-30 12:19:48

标签: javascript forms validation email

我目前正在处理一个联系表单,我已经在这方面工作了很长一段时间但是,我只是无法弄清楚如何通过JavaScript将表单发送到我的电子邮件ADRESS。

这是我的代码:

    <form id="myform" action="mailto:contact@anika.nl">

<label for="FirstName">Name:</label>
<input id="FirstName" name="FirstName" type="text" />

<label for="EMail">Email:</label>
<input id="EMail" name="EMail" type="text" />

<label for="Message">Message:</label>
<textarea id="Message" cols="20" name="Address" rows="5"></textarea>

<input name="submit" type="submit" value="Submit" />

</form>
<script type="text/javascript">// <![CDATA[
var frmvalidator = new Validator("myform");
frmvalidator.addValidation("FirstName","req","Please enter your First Name");
frmvalidator.addValidation("FirstName","maxlen=20", "Max length for FirstName is 20");
frmvalidator.addValidation("Email","maxlen=50");
frmvalidator.addValidation("Email","req");
frmvalidator.addValidation("Email","email");
// ]]></script>

有人看到我做错了什么/错过了什么吗?

0 个答案:

没有答案