Cftextarea and spry

Posted on 2009-04-30
Last Modified: 2013-12-24
Hello experts
Can i use cftextarea with spry validation.?
I want to replace my textarea with cftextarea to use the rich editor but now the spry validation i had is not working.
Any idea?
<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>

<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />

<cfform name="testform" method="get">

<span id="TextareaV">

      <cfset Betooltip = "Max characters 1000">

      <cfset BeDescription = #Form.Description#>

      <!--- code from serverside validation --->

      <cfif DescriptionError EQ 1 OR DescriptionError EQ 2>

      <cfset Beclass="Textareawarn">


       <cfset Beclass="Textarea"></cfif>      

  <textarea  tooltiptext="<cfoutput>#Betooltip#</cfoutput>"class="<cfoutput>#Beclass#</cfoutput>"name="Description" cols="74" rows="4" wrap="virtual"   id="Description"><cfoutput>#BeDescription#</cfoutput></textarea> 

  <br />

<div align="center">

      <span class="textareaMaxCharsMsg">Exceeded maximum number of characters.</span>

      There are &nbsp;<span id="countTextareaV">&nbsp;</span> characters remaining.




<script type="text/javascript">

  var TextareaV = new Spry.Widget.ValidationTextarea("TextareaV", {isRequired:false, counterId:"countTextareaV", counterType:"chars_remaining", maxChars:1000, validateOn:["blur", "change"]});


Open in new window

Question by:Panos
    LVL 63

    Expert Comment

    Look for this path:

    My path is like this:
    <script src="SpryAssets/widgets/textareavalidation/SpryValidationTextarea.js" type="text/javascript"></script>
    LVL 2

    Author Comment

    Hi Zvonko
    The code i posted is working.The problem i have and i don't know if it is working to replace textarea with cftextarea to get the advantage of richtext.
    <cftextarea richText="true"  toolbar="Basic" maxlength="999" range="0, 999" toolbarOnFocus="yes" tooltip="#Betooltip#"
     value="#Beschreibung#" html="yes" name="Description" id="Description" wrap="virtual" cols="74"  rows="4" class="#Beclass#"/>
    LVL 63

    Accepted Solution

    Let me say this way: it works but not the way you expect.
    Because every reachtext area has also a hidden textarea is the hidden textarea that is observed by Spry.
    The hidden textarea is updated on submit to reflect the richtext iframe area.
    And it contains also the formating html tags.
    So it works but not the way you need it.
    LVL 2

    Author Closing Comment

    Thank you Zvonko for your help again.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
    This article will show, step by step, how to integrate R code into a R Sweave document
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now