Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling a JS function on mouse event

 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to call a javascript function that displays a menu, on right mouse clicking on the editable fields in the jsp page.(input fields)
I use JSF components.

How should I go about for the same?

Many thanks in advance.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You write it the exact same way if you weren't using JSF, in the tag add an on click="myjavascriptfunction", or something like that, I don't have the "on click" attributes memorized.

Mark
 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But doesn't the onclick attribute refer to teh left mouse click? I would want one for right mouse click.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aparna Ram:
But doesn't the onclick attribute refer to teh left mouse click? I would want one for right mouse click.


Read the last part of my post, I wrote, I don't have them memorized, so left right mouse click no different to me in my head, they are just different attributes, I used on click because that is the only one in my head I can remember, but of course it is not for right clicking. But it doesn't matter that you are using JSF because it is not related.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic