Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I'm Trying To Hide E-Mail Using A Button

    I found a javascript somewhere that wooks well for hiding it, but I'm not having much luck coming up with a functional button. Any help would be appreciated!

    Javascript
    <SCRIPT LANGUAGE="JavaScript" type="text/javascript">
    <!--
    var addr1 = "mailto:"
    var addr2 = "so_and_so"
    var addr3 = "@"
    var addr4 = "where_ever.com"
    document.write( ' <A HREF=" ' + addr1 + addr2 + addr3 + addr4 + ' "> ' )
    document.write ( ' Email Me</A> ' )
    //-->
    </SCRIPT>

    Current Button
    <INPUT type="button" name="Button" value="E-Mail" onMouseOver="this.style.color='#a04020'" onMouseOut="this.style.color='#ffffff'" style="width:98px; color:#ffffff; font-family:Times New Roman; font-size:15px; font-weight:bold;background-color:#000000;border-width:0px;cursor: url(cursor/JDBottle01.cur)" onClick="parent.frame2.location=('mailto:so_and_so@where_ever.com?subject=Hi There!')" title="Contact Me">
    Last edited by JakeSpace; 09-09-2008 at 06:14 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,729
    Thanks
    202
    Thanked 2,507 Times in 2,485 Posts
    Code:
    <form>
    <input type = "button" value = "Click Here to Write to Me" onclick = "go()">
    </form>
    
    <script type = "text/javascript">
    function go()  {
    var addr1 = "where_ever.com";
    var addr2 = "&#64";     // more obfuscation!  @ sign concealed - changed to &#64
    var addr3 = "so_and_so";
    var fullAddr =  addr3 + addr2 + addr1;
    parent.location= 'mailto:' + fullAddr + '?subject=Hello there!'
    }
    </script>
    You can tart up the appearance of the button to suit.


    The whole aim of practical politics is to keep the populace alarmed (and hence clamorous to be led to safety)
    by menacing it with an endless series of hobgoblins, all of them imaginary.
    H.L. Mencken 1880-1956, American Editor, Author, Critic, Humorist
    Last edited by Philip M; 09-09-2008 at 09:18 AM. Reason: Obfuscate @ sign

  • Users who have thanked Philip M for this post:

    JakeSpace (09-09-2008)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •