SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    MadCool Webmaster MadCool's Avatar
    Join Date
    Jul 2002
    Location
    NYC
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Java Script Form

    I was looking at this article: http://www.ecommercebase.com/article/914/22
    Is it me or does this script not work:

    <script language=javascript><!--var username = "username";var hostname = "yourdomain.com";var linktext = username + "@" + hostname;document.write("<input type=hidden name=email value=" +username + "@" + hostname" + ">";document.write(username + "@" + hostname);//--></script>

    name=email <--- Shouldn't it be name="email" I forgot how to make quote show up in javascript. like this? '"'

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    var username "username";
    var 
    hostname "yourdomain.com";
    var 
    linktext username "@" hostname;

    document.write('<input type="input" name="email" value="' username '@' hostname '">');
    document.write(username "@" hostname); 
    this works, but i think its very bad practice to hide email addresses using javascript, (What Happens when you disable javascript, no email for you)

  3. #3
    MadCool Webmaster MadCool's Avatar
    Join Date
    Jul 2002
    Location
    NYC
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm I can't get it to work. Is this coding correct?

    <script language=javascript><!--var username = "test";
    var hostname = "madcool.com";
    var linktext = username + "@" + hostname;

    document.write('<input type="input" name="recipient" value="' + username + '@' + hostname + '">');
    document.write(username + "@" + hostname);//--></script>

    It still say recipient is missing. Any ideas?

  4. #4
    MadCool Webmaster MadCool's Avatar
    Join Date
    Jul 2002
    Location
    NYC
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no ideas?

  5. #5
    SitePoint Enthusiast Incubator's Avatar
    Join Date
    Apr 2002
    Location
    Good old Belgium
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, <input type="input" will never work because it does not exist.
    youŽll have to use <input type="text" name="Email" ...
    "Press any key to continue. Press any other key to exit."


Bookmarks

Posting Permissions

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