| Author |
Event Handlers
|
Prakash Nathan
Greenhorn
Joined: Sep 11, 2005
Posts: 6
|
|
Hi, Could you please suggest a way to implement the following requirement in JSP? Consider the following text is present in a JSP Page. "This is a sample text" When the user do a "double click" on any of the above words, i need to invoke a servlet. Is there any way to capture the 'double click' event. Thanks! Prakash A
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56549
|
|
Yes, as with everything else on an HTML page, with Javascript. Moved to the HTML forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
wrap it in a span tag and add ondblclick and call a function that posts back the page. Eric
|
 |
Rob Hunter
Ranch Hand
Joined: Apr 09, 2002
Posts: 788
|
|
Eric, Do you have a listing of browsers that support the span tag? Thanks. Rob
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
|
ALL current day browsers....It is an HTML element just like the div and table elements
|
 |
Prakash Nathan
Greenhorn
Joined: Sep 11, 2005
Posts: 6
|
|
Thanks for your replies. Let me explain wat exactly my requirement is. JSP file has the following senetence. "parameter1 parameter2 parameter3" If the user, double clicks on any of the parameter i need to invoke a servlet and pass that particular parameter to the servlet. How to accomplish it?
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
Surround them with spans as I suggested <span ondblclick="alert("bar");">foo</span> Eric
|
 |
Prakash Nathan
Greenhorn
Joined: Sep 11, 2005
Posts: 6
|
|
Hi Eric, Wrapping the text with SPAN tag is fine. But, i really have a lots of information to be displayed in the page. Example, 5-6 paragraphs. In this case, it would not be fair to wrap each & every word in the paragraph. Is there any global way to accomplish this? Prakash A
|
 |
 |
|
|
subject: Event Handlers
|
|
|