In my ASP.Net C# website, I got an order form which I want to be send via email by submitting it. The form elements are HTML and the calculations are done by JavaScript in client-side, and it has lots of form elements.
I want to be able to send the form and its filled contents by user, as PDF or JPG via email.
Maybe the form should be captured as a snapshot from client-side as an image or a print file, then maybe the file can be send from server-side by email.
I'd highly appreciate if you give me a practical described solution. Here is some parts of code as sample:
<div id="cblDomain">
<input id="cblDomain_1" value="10" onchange="subsumDomain()" type="checkbox" name="cblDomain" checked="checked"><label for="cblDomain_1">com - 10</label><br>
<input id="cblDomain_2" value="10" onchange="subsumDomain()" type="checkbox" name="cblDomain"><label for="cblDomain_2">net - 10</label><br>
<input id="cblDomain_3" value="5" onchange="subsumDomain()" type="checkbox" name="cblDomain"><label for="cblDomain_3">info - 5</label><br>
<input id="cblDomain_4" value="10" onchange="subsumDomain()" type="checkbox" name="cblDomain"><label for="cblDomain_4">me - 10</label>
</div>
<select name="ddlDomainPeriod" onchange="subsumDomain()" id="ddlDomainPeriod">
<option value="1">1 yr</option>
<option value="2">2 yrs</option>
<option value="3">3 yrs</option>
<option value="4">4 yrs</option>
<option value="5">5 yrs</option>
</select>
<div name="sum" id="sumDomain">10</div>
<script type="text/javascript">
function subsumDomain() {
var _sum = 0;
var _cblDomain = document.getElementsByName('cblDomain');
for (i = 0; i < _cblDomain.length; i++) {
if (_cblDomain[i].checked == true)
_sum += Number(_cblDomain[i].value);
}
var _domainPeriod = Number(document.getElementById('ddlDomainPeriod').options[document.getElementById('ddlDomainPeriod').selectedIndex].value);
document.getElementById('sumDomain').innerHTML = moneyConvert(_sum * _domainPeriod);
subTotal();
}
function subsumHost() {
var _hostPrice = Number(document.getElementById('ddlHost').options[document.getElementById('ddlHost').selectedIndex].value);
var _hostPeriod = Number(document.getElementById('ddlHostPeriod').options[document.getElementById('ddlHostPeriod').selectedIndex].value);
_hostDiscount = 0;
if (_hostPeriod > 1)
_hostDiscount = (_hostPrice * _hostPeriod) * 0.2;
document.getElementById('sumHost').innerHTML = moneyConvert((_hostPrice * _hostPeriod) - _hostDiscount);
subTotal();
}
</script>
Any kind help would be highly appreciated (^_^)
Kardo