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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Get email information through javascript?

    Hey guys,

    Sorry if this isn't possible at all and it offends the javascript gods.

    Anyway i'm looking for a way to gather email information from
    someone who clicks a link from within their email.

    I have an lead capture (opt in) form on my website, and I the form
    to be pre-filled with the email address they clicked through to my site
    from.

    Can this be done?

  • #2
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Typos. Sorry I can't edit posts. It should read:


    I have a lead capture (opt in) form on my website, and I want the
    form to be pre-filled with the email address they clicked through
    to my site from.

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,184
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by amoore89 View Post
    Hey guys,

    Can this be done?
    yes, and you can even pass it in a secure fashion, that is to say that the username never goes over the wire (outside of the email application, which is usually encrypted:

    say you wanted to link to this form on http://foo.bar/form/:
    Code:
    <form >
    <input type=email id=email placeholder=email name=email>
    <input type=text id=user placeholder="Enter your name" name=user >
    <input type=submit>
    </form>
    you pass the address as the hash of the url in your email:

    instead of " http://foo.bar/form/", give the user " http://foo.bar/form/#fred@email.com"

    and add a touch of script:

    Code:
    <html>
    <form >
    <input type=email id=email placeholder=email name=email>
    <input type=text id=user placeholder="Enter your name" name=user >
    <input type=submit>
    </form>
    
    
    
    <script>
      document.getElementById("email").value=location.hash.slice(1);
    </script>
    </html>
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5


  •  

    Posting Permissions

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