Want to email the contexts of this Textbox in the mailto weblink
This is what I currently have
<a href="(mailto:entry@thefanleague.co.uk?subject=FanLeague Team String">
Email Stuart</a>
Want the value of the Textbox to go directly in the Body of the email.
Realise ?body= goes into the anchor link. but not sure how to get the textbox value "document.Form1.TeamString.value" into the Body of the email.
Please note the TeamString Textbox is dynamically built by the user by a combination of different values in different comboboxes, so therefore each textbox is different for each user.
function doit()
{
document.Form1.action = "mailto:entry@thefanleague.co.uk?subject=FanLeague Team String&&body=" + document.Form1.TeamString.value;
}
Problem is: mailto: is unreliable. It relies on the user having a mail program and that program being set up 'properly'. Many are not; mine, for example.
Vinny
0
StuartKAuthor Commented:
Hi Vinny,
Thank for replying.
Gave it a try.
Changed name of function to fit with application
It didn't work. But is definately going into function since I put an alert statement at the start.
function SendTeamString()
{
alert (document.frmEntry.TeamString.value);
document.frmEntry.action = "mailto:entry@thefanleague.co.uk?subject=FanLeague Team String&&body=" +
document.frmEntry.TeamString.value;
}
Use another machine, a different browser (or different version), and it might work fine. You don't know, you can't know, and you also can't keep the user from changing the email or make the user mail it.
Process it on the SERVER, you know it works, and works for everybody. Plus spammers can't get your email from the mailto tag, because there isn't one. ;-)
You DO realize that's how they get a lot of emails, right?
0
Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.
Stuart,
webwoman does have a point. However, if your site doesn't have any serverside mail support, you can break up the addy [like below]. It won't stop human spammers, but you won't have to worry about spiders.
function SendTeamString()
{
alert (document.frmEntry.TeamString.value);
var toTxt = 'entry';
var domainTxt = 'thefanleague.co.uk';
window.location = "mailto:" + toTxt + '@' + domainTxt + "?subject='FanLeague Team String'&&body=" + document.frmEntry.TeamString.value;
}
function SendTeamString()
{
window.open = "mailto:entry@thefanleague.co.uk?subject=FanLeague Team String&body=" + document.frmEntry.TeamString.value );
}
Also, use only 1 "&". It doesn't work with two like you have above.
0
StuartKAuthor Commented:
Thanks to all who helped and gave comments.
Vinny, can't thank you enough mate.
Only issue was as hyperslug suggested only needed 1 "&" - Thanks HyperSlug
Works perfect mate.
People on EE always astonish me how much they know and how helpful they are.
Hi Webwomen, point taken about ServersideScript but I don't have that support yet. Oh and yes, I am spammed 100's of times a day due to Website. Thanks for comfirming my worst suspicions.
Hi Stuart,
It was a bit tricky, anyway here is the working code,
++++++++++++++++++++++++++++++++
<html>
<head>
<title>Insert Text</title>
<script>
function mail(){
var message = document.form1.text1.value;
alert(message);
window.location="mailto:you@you.com?subject=Insert Text&body="+message+" ";
}
</script>
</head>
<body>
<form name="form1">
<textarea name="text1"></textarea>
<input type="button" onclick="javascript:mail()" value="MAIL" />
</form>
</body>
</html>
++++++++++++++++++++++++++++++++
You're welcome. Sorry I tried answering your question with my eyes and mind still closed :D
Vinny
0
StuartKAuthor Commented:
Hi Raj,
God I'm really sorry mate, but Vinny gave me similiar code.
It's a perfect answer as well!! For people in the future looking for a similiar solution in the search engines, even though it's not the "Accepted Answer" it's just as good.
It's like I said previously, it astonishes me how helpful people are on EE.
I cannot thank you enough Raj. I hope you recognise my genuineness by showing the courtesy of replying to the post, mate.
My best wishes,
Stuart
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
function doit()
{
document.Form1.action = "mailto:entry@thefanleague
}
Problem is: mailto: is unreliable. It relies on the user having a mail program and that program being set up 'properly'. Many are not; mine, for example.
Vinny