|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Limiting Characters with COLD FUSION
I was wondering if it was possible to set a character limit for a select box with Cold fusion. The effect I'm trying to achieve is by limiting the character limit to 27. If the word(s) is longer, the extra characters should be cropped and replaced by ... making the limit really at "30"? Could CFM do somehting like that or do I have to use JAVASCRIPT? |
|
#2
|
|||
|
|||
|
You can do this with CF on the server side very easily, something like:
<cfif len( trim( form.myFormField ) ) gt 30> <cfset form.myFormField = left( trim( form.myFormField ), 27 ) & "..."> </cfif> |
|
#3
|
|||
|
|||
|
Thanks for replying! I'm gonna try that as soon as it calms down here today.
I can't wait to get up to speed with CFM, the code seems so straightforward and clean. Cheers. |
|
#4
|
|||
|
|||
|
Can I do this with a simple 'insert' record field?
I have a product description and would like to limit the size to 30 characters and have a link with a trailing '...' for folks to click for the full description. Thanks...you guys rock! -she |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Limiting Characters with COLD FUSION |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|