You are not logged in.
Pages: 1
I am new to Xinha and have not seen a sample where the TextArea is disabled. Is there a way to disable/enable the Xinhas text area? I would like the users of my application to be able to click an 'Edit' button and then have the Textarea enabled. When they click 'Save' I want the Textarea disabled. Is this possible?
Offline
I have modified the xhinaConfig.js file so that editor is loaded when the user clicks a link and not when the page loads.
Download and reference the Jquery library, I have tested with version 1.2.6
Then modify the XinhaConfig.js file:
/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */
/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk … aConfig.js */
xinha_editors=null;
xinha_init=null;
xinha_config=null;
xinha_plugins=null;
xinha_init=xinha_init?xinha_init:function(){
xinha_editors=xinha_editors?xinha_editors:["myTextArea"];
xinha_plugins=xinha_plugins?xinha_plugins:["CharacterMap","ContextMenu","SmartReplace","Stylist","Linker","SuperClean","TableOperations"];
if(!Xinha.loadPlugins(xinha_plugins,xinha_init)){
return;
}
xinha_config=xinha_config?xinha_config():new Xinha.Config();
xinha_config.pageStyleSheets=[_editor_url+"examples/full_example.css"];
xinha_editors=Xinha.makeEditors(xinha_editors,xinha_config,xinha_plugins);
Xinha.startEditors(xinha_editors);
};
$(document).ready(function(){
$("#start").click(function () {
$("#blue").css("visibility","visible");
$(document).ready(xinha_init);
});
$("#end").click(function () {
$("#blue").css("visibility","hidden");
});
});
On the page where you have your text area and wish to use the editor add the following:
<div id="controls">
<span id="start">Start</span>
<span id="end">end</span>
</div>
That’s it in its basic form, you can build upon this as you like, in our final solution we have used radio buttons to toggle and activate the text editor.
There may be better ways to do this, but I’m sure this will help noobs like myself get started and in the right direction very quickly.
Offline
Pages: 1