• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

How to clear the suggester table on Mouse click outside the table?

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm having a problem with a suggester table, as it doesn't clear if i click outside the area. Let me explain the problem..

I'm using Ajax call to fetch suggestions as I type into a text box, the results are set inside a <div> using a <table> dynamically. Now, I want to clear/close the suggester table if i click outside the area, just like a normal combo box would behave. When I tried clearing at 'onblur' of the text box, the value selection is also not possible. This, I feel, is because the table is detected as outside of the text box, n hence its closed. What I'd like to know is if there's any way of finding out the target-element, so that i can check whether its the table or outside. Not too sure about this as the table too is dynamically generated.

Thanks in advance! n sorry for the long description given ;)
Posts: 67496
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the target element is available in the Event instance. Bear in mind that IE uses a proprietary event model so you have to special-case it (unless you are using a library such as jQuery).
Sailesh Ganeshan
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi BB,
thanks for the reply, but i'm still in need of a solution.. , as i'm unable to use target element here..
the problem is, i use a dynamically generated table, which is not recognised during runtime.
Have you no shame? Have you no decency? Have you no tiny ad?
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic