Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Oct 22, 2012 Oct 22, 2012

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?

448
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 22, 2012 Oct 22, 2012
LATEST

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.

^_^

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources