You are not logged in.
Hello.
I would like to make the "Toggle HTML source" feature out side of the pannel, such as
<a href="javascript: what shoud I put here????">Toggle HTML source</a>
Any help wil be apreciated.
Offline
If you have followed the NewbieGuide you may have a javascript variable named xinha_editor, let's assume you have it.
Now, let's say the textarea you have transformed was named myprettyarea
<form>
<textarea name="myprettyarea" id="myprettyarea">
</form>
In this case, you can use the javascript variable xinha_editor.myprettyarea. Which means, you can simply do this kind of thing :
<a href="#" onclick="xinha_editor.myprettyarea.setMode(); return false;">Toggle HTML and WYSIWYG</a><br>
<a href="#" onclick="xinha_editor.myprettyarea.setMode('text'); return false;">Set HTML mode</a><br>
<a href="#" onclick="xinha_editor.myprettyarea.setMode('wysiwyg'); return false;">Set WYSIWYG mode</a>
Offline