Grow your CSS skills. Land your dream job.

clearing text box value

  • # August 6, 2009 at 4:46 pm

    hello every one, i wrote this code, i want to clear the textbox value with this:

    Code:






    please tell me what wrong with this code?
    when i click on reset button nothing happen

    # August 7, 2009 at 1:13 am

    Your code actually is working… just not in the way you think it should. At the moment, if you load the form, then click the button, it appears that nothing happens. However, try reloading the page, changing the value of the text element, and then clicking the reset button. Currently, your jquery code resets everything back to their default values. Since the text element has a default value of "defult", it will go back to that.

    That being said, perhaps you should look at this article, which may give you a slightly different perspective:
    http://www.learningjquery.com/2007/08/c … -form-data

    # August 7, 2009 at 2:02 am

    thank u falkencreative,
    i solve that, it is not good idea that using <input type="reset"> for handling the clear function,
    because when i press the reset browser try to change the value to "defult" and .val(”)doesn’t work,
    changing type of input to BUTTON can solve this issue.

    [sorry for my english]

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".