Issue with cftextarea using inbuilt fckeditor

I have added my cftextarea as in my form as:

<cftextarea id="answer3" skin="office2003" wrap="hard" name="answer3" cols="60" rows="5" tabindex="3" value="#url.answer3#" richtext="yes" toolbar="Default" class="textarea_3"></cftextarea>

when i view the same in my browser, it shows as:

<textarea name="answer3"  id="cf_textarea1323885145535" class="textarea_3" tabindex="3" cols="60" rows="5" wrap="hard" ></textarea>

its id changes everytime it is refreshed..

Now the thing is, i am clearing all the form fields on submit, i am using it as:

document.getElementById('form2').reset();      

it resets the whole form and clear all fields, but it does not clear the textarea with riuchtext, i am confused why it is not clearing

Let me know, Please, Buy the way i am doing the call ajax based and it is returing the values without page refresh..

LVL 16
Gurpreet Singh RandhawaCEOAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
Try this :
var current_textarea_ID = document.getElementsByName("answer3")[0].id; // I assume you've only one form element with the name "answer3" : your textarea
var Editor1 = FCKeditorAPI.GetInstance(current_textarea_ID);
Editor1.SetHTML("");
document.getElementById('form2').reset();

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gurpreet Singh RandhawaCEOAuthor Commented:
Excellent mate
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.