PDA

View Full Version : Hyperlink and Mailto within JavaScript alert box?



SnicoleK
01-31-2006, 01:34 AM
Hi,

I'm sure there's a way to accomplish this...without continually beating my head against my keyboard. :(

Hopefully someone can point me in the right direction.

How do I add a hyperlink within a JavaScript alert box?
And how would I add a mailto link within a JavaScript alert box?

Thanks,
SnicoleK







PUPKUS (pup' kus) n. The moist residue left on a window after a dog presses its nose to it.

SnicoleK
01-31-2006, 03:41 PM
Thank you very much to jscheuer1 for this response:

"You cannot do that, alerts are for text only, you cannot even control the font used. Here is a link to a DD script that will allow you to generate a drop down box that can have your link on it:"

http://dynamicdrive.com/dynamicindex17/dropinbox.htm

Regards,
SnicoleK

thomas_is_here
06-14-2008, 07:41 PM
There is a way that can ask a series of questions and then send you to a mailto or hyperlink.

Here are four separate buttons. Click here for a live example (http://www.floodge.com/linksinalerts.htm).

<html>
<body>
<input type="button" onClick='alert("Goodbye."); window.location = "http://www.google.co.uk/"' value="Google">
<input type="button" onClick='alert("Mail me?"); window.location = "mailto:thomas.tillotson@floodge.com"' value="E-Mail">
<input type="button" onClick='if (confirm("Do you want to go to google?")){window.location = "http://www.google.co.uk/"}else{}' value="Ask Google">
<input type="button" onClick='if (confirm("Do you want to email me?")){window.location = "mailto:thomas.tillotson@floodge.com"}else{}' value="Ask Mail">
<input type="button" onClick='number2(); function number2() {if (confirm("Mail me")){alert("thomas.tillotson@floodge.com"); window.location = "mailto:thomas.tillotson@floodge.com"}else{if (confirm("go to google")){alert ("to google with you"); window.location = "http://www.google.co.uk/"}else{if (confirm("repeat choices")){number2()}else{alert ("ok then")}}}}' value="Click Here">
</body>
</html>