How do I establish (email button)
I have tried to change a link on a web page from a simple "mailto" link to a button that inludes a mailto.
The command line I used includes the instruction
onclick="parent.location='mailto:info@
If I try to use the page with this command, the mail programme is called and the email is sent but is never received in the mail box.
I presume it is in hte definition of the parent.location. I have asked the support people at the hosting site, all I get is that the whole of the bin is cgi enabled,
Any suggestions gratefully received
Thanks
Rob
derekharvey posted this at 02:14 — 21st April 2007.
They have: 2 posts
Joined: Apr 2007
Have you tried:
OnClick="mailto:[email protected]"
RobM posted this at 14:49 — 27th April 2007.
They have: 2 posts
Joined: Apr 2007
Did try that, but nothing happens
Suggestions appreciated. Currently I am not using CSS so easiest solutions please
Rob
kb posted this at 16:09 — 27th April 2007.
He has: 1,380 posts
Joined: Feb 2002
Try using a function?
<input .... onClick="sendEmail(the_id)" />
'function sendEmail(the_id) {
document.write('mailto:[email protected]');
}
I'm not really sure if that will even work, but maybe try implementing a function rather than use a direct javascript command. That's my basic point.
derekharvey posted this at 11:22 — 28th April 2007.
They have: 2 posts
Joined: Apr 2007
This works, i have also added the ablity to add a default subject and default body text. This should work fine.
<script>
function openEmailClient(emailAddress, theSubject, theBody)
{
var locationString = '';
if (!emailAddress)
alert("No E-mail Specified");
else
{
locationString += 'mailto:' + emailAddress + '?1=1';
if (theSubject)
locationString += '&subject=' + theSubject;
if (theBody)
locationString += '&body=' + theBody;
window.location = locationString;
}
}
</script>
click me
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.