Skip to main content
Participant
October 22, 2012
Question

Use <cfset..> to assign variable from screen click/hover mouse event

  • October 22, 2012
  • 1 reply
  • 475 views

I have rollover buttons: A  B C D E ..... Z and I want to assign a variable to the letter that is hovered or clicked by the mouse.

example <CFSET findchar = 'A%'> when user clicks or hovers over the "A"

Is is possible to read the text from the page on a mouse hover or click event and then use something like: <cfset findchar=(text on from mouse event)> to set the text to a string variable so that it can be used in a query like the one below?

<cfquery name="name" datasource="source">

SELECT * FROM Personnel

WHERE LastName like '#findchar#'

ORDER BY LastName ASC, FirstName ASC;

<cfquery>

Or does this require javascript?

This topic has been closed for replies.

1 reply

WolfShade
Legend
October 22, 2012

You could use AJaX to set a session variable.

Just have another page (just for this functionality) that will set the session.findchar to whatever letter was clicked.

^_^