Form Question...

Discussion in 'HTML & Website Design' started by jtaylo49, Dec 17, 2009.

  1. #1
    Hello everyone, this will hopefully be a simple question.

    How do I get this form to clear what is in the input fields when a user clicks on it:

    http://gator1120.hostgator.com/~rrm1/

    Thanks!
     
    Last edited: Dec 17, 2009
    jtaylo49, Dec 17, 2009 IP
  2. Lex350

    Lex350 Notable Member

    Messages:
    1,889
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    215
    #2
    You don't want to but the text next to the box?
    <td width='125px' align='left'><font color='red'>Name:</font></td>
    <td align='left'><input name='Name' type='text' class='textbox-style' id='Name' size='35' maxlength='50' value='" td>

    I'm sure theres an easy answer to put in the box and the it clears, I've seen it before.
     
    Lex350, Dec 17, 2009 IP
  3. jtaylo49

    jtaylo49 Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Nah I want it in the input field but i want it to clear when you click it. I imagine its javascript or something and id google it but i dont know what to google exactly.
     
    jtaylo49, Dec 17, 2009 IP
  4. Oldspice

    Oldspice Peon

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This should fix it.

    <input type="text" class="input" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'*Your Name':this.value;" value="*Your Name" name="Name"/>



    Edit:Typo
     
    Last edited: Dec 17, 2009
    Oldspice, Dec 17, 2009 IP
  5. jtaylo49

    jtaylo49 Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you! I gave you a positive Rep.
     
    jtaylo49, Dec 18, 2009 IP
  6. submitmaster

    submitmaster Well-Known Member

    Messages:
    329
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #6
    looks like you had it fixed, good job
     
    submitmaster, Dec 18, 2009 IP