Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating items in a value list

Status
Not open for further replies.

RikForgo

Programmer
Jul 31, 2002
59
US
The dynamic list form that I've created is working fine, but some of the titles are un-Godly long and are causing layout problems because the list field gets stretched so wide. Is there a way to truncate the values in the list to no more than 50 characters or so (and add a little elipsis on the end "...")

My query looks like:

<CFQUERY NAME=&quot;get_ws&quot; DATASOURCE=&quot;attro&quot;
CACHEDWITHIN=&quot;#CreateTimeSpan(0,0,15,0)#&quot;>
SELECT system, wsh_year, id
FROM wsh
WHERE wsh_year = '2002'
ORDER BY system, wsh_year
</CFQUERY>

----------------------------------

My submit form looks like:

<cfselect name=&quot;SearchCriteria&quot; message=&quot;Your query is blank - please enter a word or phrase.&quot; query=&quot;get_ws&quot; value=&quot;id&quot; display=&quot;system&quot; selected=&quot;#FORM.SearchCriteria#&quot; class=&quot;button2&quot;>
<option value=&quot;&quot;>Select a system</option>
</cfselect>

Any ideas?
 
Left(string, count)

Try:

<cfselect name=&quot;SearchCriteria&quot; message=&quot;Your query is blank - please enter a word or phrase.&quot; query=&quot;get_ws&quot; value=&quot;id&quot; display=&quot;system&quot; selected=&quot;#Left(FORM.SearchCriteria, &quot;50&quot;)#&quot; class=&quot;button2&quot;>
<option value=&quot;&quot;>Select a system</option>
</cfselect>
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top