Skip to content

Instantly share code, notes, and snippets.

@fwahlqvist
Forked from evo42/readme.md
Created October 27, 2012 22:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwahlqvist/3966592 to your computer and use it in GitHub Desktop.
Save fwahlqvist/3966592 to your computer and use it in GitHub Desktop.
Aloha Editor with textarea

Using Aloha Editor with your textarea

This is an example on how to use Aloha Editor with a traditional editable.

Note: If the textarea has a HTML ID (eg. mytxtarea) the ID of the Aloha editable will be “-aloha” suffixed (eg. mytxtarea-aloha).

For more information see the Aloha Editor Guide: http://aloha-editor.org/guides/core.html

<?php
if (!empty($_REQUEST['myaloha-area'])) {
echo '<pre>';
print_r($_REQUEST);
echo '</pre>';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>The Aloha Editor - Just another debugging page</title>
<link rel="stylesheet" href="../aloha-editor/css/aloha.css" id="aloha-style-include" type="text/css">
<script src="js/aloha-config.js"></script>
<script src="/aloha-editor/lib/aloha.js" data-aloha-plugins="common/format"></script>
</head>
<body>
<h1>Form + Textarea</h1>
<form method="get" id="myform">
<textarea id="myaloha-area" name="myaloha-area" cols="100" rows="15"></textarea>
</form>
<button id="submitForm">submit the form</button>
<script type="text/javascript">
Aloha.ready( function(){
var $ = Aloha.jQuery;
$('#myaloha-area').aloha();
$('#submitForm').click(function(){
$("form:first").submit();
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment