Sending an email in Javascript
can you please let me know why am unable to send form data to a mail id.below is my code. And I used this code in Dotnetnuke HTML/TEXT module.
<h3>To join the SoTeC email announcement list, fill out the form below.</h3> <p> </p> <p> </p> <p><style type="text/css"> .link, .signupframe {
color: #226699;
font-family: Arial, Helvetica, sans-serif;
}
.link {
text-decoration: none;
}
.signupframe {
border: 1px solid #000000;
background: #ffffff;
}</style></p> <form id="icpsignup12374" method="post" action="mailto:your@domian.com" onsubmit="return verifyRequired12374();" accept-charset="UTF-8" name="icpsignup">
<input type="hidden" name="redirect" value="http://www.icontact.com/www/signup/thanks.html" /> <input type="hidden" name="errorredirect" value="http://www.icontact.com/www/signup/error.html" />
<div id="SignUp">
<table class="signupframe" border="0" cellspacing="0" cellpadding="5" width="260">
<tbody>
<tr>
<td valign="top" align="right"><font size="2">First Name</font></td>
<td align="left"><input name="fields_fname" type="text" /></td>
</tr>
<tr>
<td valign="top" align="right"><font size="2">Last Name</font></td>
<td align="left"><input name="fields_lname" type="text" /></td>
</tr>
<tr>
<td valign="top" align="right"><font size="1" face="Arial,Helvetica, sans-serif">*</font> <font size="2">Email</font></td>
<td align="left"><input name="fields_email" type="text" /></td>
</tr>
<tr>
<td> </td>
<td><font size="1">*<开发者_如何学JAVA/font><font size="2"> = Required Field</font></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</tbody>
</table>
</div> </form> <script type="text/javascript"> var icpForm12374 = document.getElementById('icpsignup12374'); if (document.location.protocol === "https:")
icpForm12374.action ="mailto:your@domian.com"; function verifyRequired12374() { if (icpForm12374["fields_email"].value == "") {
icpForm12374["fields_email"].focus();
alert("The Email field is required.");
return false; }
return true; } </script> <p><a class="link" href="http://www.icontact.com"><font size="2">Email Marketing You Can Trust</font></a></p>
**
Because nested forms aren't allowed. DNN is an ASP.NET WebForms Application and as such already wraps everything in a form. When you add your form to the Text/HTML module, that code is placed within the already existing form and that's not allowed. You have a few options:
1) You can place your form code in an HTML file and then reference that file in an IFrame.
2) You can recreate the form using one of the many DNN Form Modules out there. The core includes the Form and List module that works for basic forms. There are many other Forms modules varying complexity available.
3) You can create a new custom module that recreates the form and does the post using AJAX.
It looks like our mailing list subscribe module might do what you need with some slight modifications. - http://www.efficionconsulting.com/dotnetnuke/modules/mailing-list-subscribe.aspx
精彩评论