Link to home
Start Free TrialLog in
Avatar of granholmen
granholmenFlag for Norway

asked on

button that links to both javascript-function and mailto:xxx@domain.com open a new email twice

Avatar of HugoHiasl
HugoHiasl

It is executing the onclickhandler first and then redirecting to the href-target.

Try adding a

;return false

to the onclick-handler
ASKER CERTIFIED SOLUTION
Avatar of npcw
npcw
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of granholmen

ASKER

Nothing less than perfect - the code from npcw :) and I will accept the solution,  to make it even more perfect do I have a one more question, or - should I post it as another problem? I will if u tell me to.

The question:
This an axample of what comes into the email:

"Du har valgt følgende hotell:<br><br>Grand Hotel<br>Best Western Karl Johan Hotell<br>Rica Victoria Hotel<br>Best Western Karl Johan Hotell"

As you see, the linebreakes in the div also comes into the email. Is there any way to get rid of them - and replace the code <br> with real linebreakes in the email?

Agein...should I post this as a new question?

I made a new question about the comment above.
what is the link to the next question?