Can I Reset 1 form field without resetting all of them?

Discussion in 'PHP' started by baris22, Jan 25, 2010.

  1. #1
    hello,

    I am trying put a reset button which will only clear the text on description field. the other fields will remain same.

    i am using this but it does not work. it clears all the fields. What can i do to clear only the field i want to clear?

    
    
    <input type="button" value="Reset Form" onClick="this.form.reset()" />
    
    
    PHP:
     
    baris22, Jan 25, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    danx10, Jan 25, 2010 IP
  3. bitist

    bitist Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Instead of use the reset() to reset the whole form, just clear the filed what you want:
    <input type="button" value="Reset Form" onClick="this.form.description.value=''" />
    PHP:
     
    bitist, Jan 27, 2010 IP