• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Greenhorn
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 ;)
 
Marshal
Posts: 67496
173
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
Greenhorn
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
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic