Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

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">
      <cfelse>
       <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.
  </div>
 </span>
 </cfform> 
<script type="text/javascript">
 
  var TextareaV = new Spry.Widget.ValidationTextarea("TextareaV", {isRequired:false, counterId:"countTextareaV", counterType:"chars_remaining", maxChars:1000, validateOn:["blur", "change"]});
 </script>

Open in new window

Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Look for this path:
SpryAssets/SpryValidationTextarea.js

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

ASKER

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#"/>
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Thank you Zvonko for your help again.
regards
Panos