Hello All,
I have 3 LOB codes in a dropdownlistbox. Based on the selected item I would like my web page to automatically populate FCKeditor with different comments/values. Any suggestions or ideas would be greatly appreciated.
I have 3 LOB codes in a dropdownlistbox. Based on the selected item I would like my web page to automatically populate FCKeditor with different comments/values. Any suggestions or ideas would be greatly appreciated.

Re: POULATE THE FKCEDITOR USING A DROPDOWNLIST
I say 'easy' but it can actually be quite tricky. I did it this way:
When your 'editing' page loads, use JavaScript to create an array containing the data that you wish to put into your dropdown list - call this 'arrComboItems' or something similar.
Create a new FCKeditor plugin which creates the actual dropdown and injects its content into your editing area.
Add your dropdown plugin to FCKeditor's toolbar.
Here's the plugin code. It should be saved in a file called 'fckplugin.js' and placed in its own folder called 'injectdropdowndata' or similar, which itself should reside inside 'fckeditor/editor/plugins'.
//FCKMyDropDown 'command' var FCKMyDropDown = function(name) { this.Name = name ; } //This get's executed when an item from the dropdown list gets selected FCKMyDropDown.prototype.Execute = function(itemID, item) { if (itemID != "") FCK.InsertHtml(item.innerHTML); } FCKMyDropDown.prototype.GetState = function() { return; } FCKCommands.RegisterCommand( 'InjectDropDownData' , new FCKMyDropDown('InjectDropDownData') ) ; //FCKMyDropDown 'Object' //This creates the FCKMyDropDown object var FCKToolbarMyDropDown=function(A,B){ this.Command=FCKCommands.GetCommand('InjectDropDownData');//the command to execute when an item is selected this.CommandName = 'InjectDropDownData'; this.Label=this.GetLabel(); this.Tooltip=A?A:this.Label; this.Style=B?B:FCK_TOOLBARITEM_ICONTEXT; }; FCKToolbarMyDropDown.prototype=new FCKToolbarSpecialCombo; FCKToolbarMyDropDown.prototype.GetLabel=function(){ return "Insert Dropdown List Data"; }; //This adds the items to the FCKMyDropDown list FCKToolbarMyDropDown.prototype.CreateItems=function(A){ try { // arrComboItems is the name of the array you created in your page if (parent.arrComboItems != undefined) { if (parent.arrComboItems.length == 0) { this._Combo.AddItem('', '<span style="font-size: 9pt;">No options available</span>'); } else { for (var i = 0; i < parent.arrComboItems.length; i++) this._Combo.AddItem(parent.arrComboItems[i][0], parent.arrComboItems[i][1], parent.arrComboItems[i][2]); } } else { this._Combo.AddItem('', '<span style="font-size: 9pt;">No options available</span>'); } } catch(err) { this._Combo.AddItem('', '<span style="font-size: 9pt;">No options available</span>'); } } //This registers the plugin with the FCKEditor FCKToolbarItems.RegisterItem( 'InjectDropDownData', new FCKToolbarMyDropDown( 'InjectDropDownData', FCK_TOOLBARITEM_ICONTEXT ) ) ;And for the JavaScript in your 'editing' page that creates the dropdown data:
<script language="javascript"> var arrComboItems = new Array( new Array('1', '<span>Granny Smith, Cox, Bramley, Golden Delicious</span>','Apples'), new Array('2', '<span>Tangerine, Clementine, Satsuma, Mandarin</span>','Oranges'), new Array('3', '<span>Conference, Comice, Concorde, Worcester Black</span>','Pears') ); </script>Finally, add the plugin to your toolbar (in fckconfig.js):
There's probably better ways to achieve this. It's rather long-winded, but it works for me. In my case, I'm pulling out CMS page IDs/titles from a database and using it to insert hyperlinks into my WYSIWYG area.
Oh, and I haven't tested any of the above code - I've just taken it from my plugin and changed a few values. Good luck!
HTH,
Cheers.