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'.
And for the JavaScript in your 'editing' page that creates the dropdown data:
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.