SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Run function when user writes text a field

    hi,

    Just a quick one....whats the best way to tell if a user has enterered/is entering text in to a text field? Which event handler would i use? I want the function attached to the event handler to run preferable when they've finished typing but i think thats unrealistic?

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dammit....found what i was looking for in the end....i just loooked at some autocomplete scripts and got an idea from that.....im now using the onkeypress event...onkeypress im checking if the enterted string is longer than four chars and if it is i run my ajax script....the results then appear in a nice box below

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd be better off using onkeyup.

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Why do you say that?


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
  •