SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Best way to update input fields automatically?

    Hi, I have a very simple form which has a few input fields that need to be calculated to a single input field with the total.

    I'm wondering what jQuery function is best for automatically updating the total field, whenever one of the input fields is entered? Can you do .change with an input field? Or what about .blur? Thanks for any advice.
    renkai.com

  2. #2
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it seems that .change() does work on an input field, which I like and may stick with. .blur() also works too.

    Any differences here in browser support?
    renkai.com

  3. #3
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    265
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    Try with query keydown. This event is triggered when user presses a key on the keyboard. It works for input text fields.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners


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
  •