/    Sign up×
Community /Pin to ProfileBookmark

emails and onclicks

Hi, help please javascript people. Man I’ve been looking all day again after several days with no answer to this problem. Emails seem to only open in new windows when used with a href on text or images only. I am trying to open an email in a new window using a button or submit button instead because I would rather use a button instead of the others. Can’t find anything to help me.

If javascript is the only way I’ll take it. What happens is the email opens but the page it was launched from disappears. I would like them both to remain so that when the email is sent it is easy to find the last page again. I tried the following using onclick but once again won’t open in a new window. Even if you have some sort of code that sends me back to a certain page when the email is sent, would work too. The following example is an example only and I don’t need to use it, doesn’t open a new window anyway, will try anything. Thanks a lot!

<form onclick=”NewWin=window.open(‘mailto:myemailaddress@myemailaddress’,’Newpagename’);” type=”submit” /></form>

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJun 12.2006 — [b]mailto:[/b] is unreliable in a web page. Don't use it over the Int[U]er[/U]net. In an int[U]ra[/U]net, it is fine if you can guaruntee every user will have a local email client which will support the full use of the [b]mailto:[/b] protocol.
Copy linkTweet thisAlerts:
@RiannaauthorJun 12.2006 — Then how are all these web sites providing email links? The only ones I see are using the mailto: Please let me know, thanks.
Copy linkTweet thisAlerts:
@phpnoviceJun 12.2006 — They can provide them -- but that doesn't mean they work in all cases. For example, visitors that use the HTML interface of Yahoo cannot utilize a [b]mailto:[/b] link at all. Also, visitors that use AOL will only get the email address and, maybe, the email subject from a [b]mailto:[/b] but they will have a blank email body.

The most reliable Internet email method is to use server-side code. Serious websites only use server-side email. Those that don't know any better, use [b]mailto:[/b] and are totally unaware that fully half of their visitors cannot use such a link.
Copy linkTweet thisAlerts:
@RiannaauthorJun 12.2006 — OK you have helped me several time so I'll look into it. I have AOL though and don't have any problem and imagine that most browser will try to support mail to since so many people use it. Thanks. ?

In the meantime if anyone has any other suggestions please let me know.

....I looked into it and my server can't help me. My host only has a form I can use and I don't want a form on all my pages. I do want an email option on all my pages though.
Copy linkTweet thisAlerts:
@phpnoviceJun 12.2006 — I have AOL though and don't have any problem...[/QUOTE]
Yeah? They must have changed things. When I had AOL, I experienced the problem first-hand. ?
×

Success!

Help @Rianna spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...