• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

Cftextarea and spry

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

  • 2
  • 2
1 Solution
ZvonkoSystems architectCommented:
Look for this path:

My path is like this:
<script src="SpryAssets/widgets/textareavalidation/SpryValidationTextarea.js" type="text/javascript"></script>
PanosAuthor Commented:
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#"/>
ZvonkoSystems architectCommented:
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.
PanosAuthor Commented:
Thank you Zvonko for your help again.

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now