heya
I’m using mailto function on my page; I have textarea field where user can write some text, now I want to include that text in body of email, when user click on mailto function which is behind link.
The problem is how to prepare link for mailto function. I did some experiments, but I have still some problems. When I click on link (well now is mouseover efect) new page is loaded and mailto is prepared.
Any sugestions how to change the code, that the function will work as I wish?
thanx in advance
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
<title>testing mailto</title>
</head>
<body>
<form id="test">
<p>
<input type="textarea" name="test" id="test" size="10" value="tralala">
<a OnMouseOver="protectmail2()">mail me test value</a>
</p>
</form>
<script language="JavaScript" type="text/javascript">
var name = "webmaster";
var address = "domain.com";
var link = "Mail me!";
var subject = "Feedback";
var body = document.getElementById("test").test.value;
function protectmail2() {
document.write('<a href=mailto:' + name + '@' + address + '?subject=' + subject + '&body=' + body + '>' + link + '</a>');
}
</script>
</body>
</html>