Show first 25 characters or so of textarea

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Show first 25 characters or so of textarea

    I want to do something you see all the time in forums, show a short bit of the
    textarea followed by .... and linked to show the whole thread I can do the
    linking part no prob, how do you show a limited amount of a text area followed
    by the ......?



    thanks

    sattman Guest

  2. Similar Questions and Discussions

    1. problems with some characters in TEXTAREA
      Hello all, When characters like " are used in a textarea-field the content of the form is not exactly what you expect from it. When you want to...
    2. Special Characters in Flash don't show in Director
      I have created a Flash movie in Flash MX and imported it into Director 8.5. There are some special characters in the movie, for spanish text, that...
    3. Removing carriage returns from <textarea></textarea> input
      Hiya, I have a form with a <textarea></textarea> to receive user input. This input is then stored in a database and sent by fax... I need to...
    4. Textarea - Limit Amount of Characters?
      "Ralph Freshour" <ralph@primemail.com> wrote in message news:cr6bkvc5rsi9o355ff50c7746iu0omq6kk@4ax.com... I suspect *limiting* the amount of...
    5. Is there a way to only allow a textarea to hold a certain # of characters?
      Is there a way to only allow a text area to hold a certain amount of characters? What I mean by this, is when you type in it, it will only allow...
  3. #2

    Default Re: Show first 25 characters or so of textarea

    With the left function followed by the periods and question mark.

    Originally posted by: sattman
    I want to do something you see all the time in forums, show a short bit of
    the textarea followed by .... and linked to show the whole thread I can do the
    linking part no prob, how do you show a limited amount of a text area followed
    by the ......?



    thanks



    Dan Bracuk Guest

  4. #3

    Default Re: Show first 25 characters or so of textarea

    sattman,

    You might be interested in the FullLeft() udf at cflib.org. It uses regular
    expressions to find whole words which is typically more efficient than looping.
    The example below would produce the output:

    Today's date is November 6, 2005. The ...

    <!--- include the UDF --->
    <cfinclude template="fullLeft.cfm">
    <cfset shortText = fullLeft(fullText, 40)>
    <cfoutput>#shortText#</cfoutput>
    <cfif len(shortText) lt len(fullText)>...</cfif>

    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139