SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Form & Email

  1. #1
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Paris
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form & Email

    Code JavaScript:
    <input class="inputcombo" id="burncode2" name="burncode2" type="text" onfocus="if (this.value=='') this.value='';" onblur="if (this.value=='') this.value='';" size="20" value="" />
                        <span id="ButtonGetCode" class="send">Submit</span>

    Hello
    I would like to know how to make the email disapear from the field where it is entered when i submit the form!
    On a PHP/Java/XML/Javascript/MySQL internship right now!

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This code:
    Code:
    if (this.value=='') 
      this.value='';
    tests the value of the input element to see if it's empty, and if it is, make it empty. So it does nothing.

    Not sure what you're trying to do really (clear out the value when the item is clicked/submitted?) Maybe simply:
    onfocus = "this.value='';"

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sometimes the browser's auto-complete feature populates email fields for you - that has tripped me up before.


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
  •