Skip to main content
Inspiring
June 23, 2011
Answered

Help with CFTOOLTIPs

  • June 23, 2011
  • 1 reply
  • 618 views

I have a select tags, it is populated by name of companies. Some names are very long they kinda deformed the form.

So in order to prevent that from happening, I use:

The left function to pull only 70 chars, if company's name is more than 70, dots show instead:

<select name="CompName">

   <option value="">Please choose from the following company:</option>

   <cfoutput query="GetComp">

   <option value="#compId#">

      <cfif Len(compName) LT 70>

         #compName#

      <cfelse>

         #LEFT(compName,70)#....         <<<<< 

      </cfif>

  </option>

  </cfoutput>

  <option value= "other">Other funds</option>

</select>

Since some of the company names look similar, I tried to put a cftooltips on name that is shorten by my Left() function, so when users hoover their

mouse over this name a full name will show up as a tool tips.

Do CFTOOLTIPS able to do this? I tried it and it did not work! may be I did something wrong?

Here is my codes with CFTOOLTIPS:

<select name="CompName">

   <option value="">Please choose from the following company:</option>

   <cfoutput query="GetComp">

   <cftooltip sourcefortooltip="createtooltips.cfm?compid=#compId#&compCode=#compCode#">  <<<<<<

   <option value="#CompId#">

      <cfif Len(compName) LT 70>

         #compName# 

      <cfelse>

         #LEFT(compName,70)#....         <<<<< 

      </cfif>

  </option>

</cftooltip>

  </cfoutput>

  <option value= "other">Other funds</option>

</select>

In createtooltips.cfm: I just have cfquery querying the db based on url.compid and url.compCode

Did I do somethign wrong or cftooltips don't work with select tags?

This topic has been closed for replies.
Correct answer LyndonPatton

It's not a cftooltip solotion but I just do this:

<cfoutput query="GetComp">

   <option value="#CompId#" title="#compName#">

      <cfif Len(compName) LT 70>

         #compName#

      <cfelse>

         #LEFT(compName,70)#....         <<<<<

      </cfif>

    </option>

  </cfoutput>

1 reply

LyndonPattonCorrect answer
Inspiring
June 24, 2011

It's not a cftooltip solotion but I just do this:

<cfoutput query="GetComp">

   <option value="#CompId#" title="#compName#">

      <cfif Len(compName) LT 70>

         #compName#

      <cfelse>

         #LEFT(compName,70)#....         <<<<<

      </cfif>

    </option>

  </cfoutput>