Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 535003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:40:15+00:00 2026-05-13T09:40:15+00:00

Well i first wrote a Javascrip function that would change the text in a

  • 0

Well i first wrote a Javascrip function that would change the text in a textarea according to the selection you made in a dropdown box, a really simple thing.

HTML

<form name="formconteudo">
<select name="selectpage" onChange="change();">
<option value="1">something</option>
<option value="2">another thing</option>
<option value="3">going crazy</option>
</select>
</form>

JS

var Code = new Array("", "Selected 1", "Selected 2", "Selected 3");
function change()
{
var ID =  formconteudo.selectpage.options[formconteudo.selectpage.selectedIndex].value;
document.formconteudo.ckeditor.value = Code[ID];
}

This worked pretty good and changed the text in the textarea. But then i called a CKeditor Instance on that textarea, so that i can use the CKEditor on that textarea. The Editor loads well and works great. But now the javascript isn’t working.

Any hint on the problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:40:16+00:00Added an answer on May 13, 2026 at 9:40 am

    You are going to want to use the setData method on the editor.

    Here is the example from their docs.

    CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' );
    

    Which means your code will look something like this:

    var Code = new Array("", "Selected 1", "Selected 2", "Selected 3");
    function change()
    {
    var ID =  formconteudo.selectpage.options[formconteudo.selectpage.selectedIndex].value;
    CKEDITOR.instances.editor1.setData( '<p>' + Code[ID] + '</p>' );
    }
    

    Note instances.editor1 may not refer to your box, so be sure to use the right name

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In reponse to this question I wrote this function (well, I made it a
A friend of mine claims that calls to Debug.Print() as well as first-chance exception
This is my first experience with javascript, and... Well... Ugh. Here's what's happening: function
To implement depth-first search in a grid, I wrote a function like this (define
Well, first of all sorry about this question it must be pretty straight forward
Well, in my first version of my service, I have a duplex contract, so
well this is my problem i use 2 source first query (select * from
Well, I've started with iPod/iPhone programming using Head First iPhone Development (O'reilly) and I'm
I built my first site with jQuery and overall it turned out quite well
First, I don't know where to ask this question. Well this is programming QA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.