1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
|
<!------------------------------------------------- the form ------------------------------------------------->
<div id="ckeditorInstance" class="modalForm" style=" display: none">
<div id="floatThis" class="formBorder">
<form name="ck_formName" id="ck_formID" action="">
<table>
<tr>
<td>
<textarea class="ckeditor" id="editableArea_id" name="editableArea_name" style=" width: 650px; height: 200px; "></textarea>
<script type="text/javascript">
var editableArea_name = CKEDITOR.replace( 'editableArea_name',
{
toolbar : [
['Source'],
['Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink'],
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],
]
});
</script>
</td>
</tr>
<tr>
<td style=" text-align: right; "><input type="submit" value="Place Content"></td>
</tr>
</table>
</form>
</div>
</div>
<!------------------------------------------------- form submission script ------------------------------------------------->
$('##ck_formID').submit(function() {
var ckeditorInstanceValue = document.ck_formName.editableArea_name.value;
var contentToPlace = '<div style=" width: 315px; height: 470px; overflow: hidden; margin: 0px; padding: 0px">' + ckeditorInstanceValue + '</div>';
document.getElementById('ckeditorInstance_placed').innerHTML = contentToPlace;
/////// if there are more than 750 characters, warn user of possible truncation
if (ckeditorInstanceValue.length >= 750)
{
$('##Notification').jnotifyAddMessage({
text: '<h3>WARNING!!!</h3><p>If the content being placed is greater in size than its container, the excess content will be truncated (hidden). Please verify that the content being added is complete post to placement and make corrections accordingly.</p><h4>WARNING!!!</h4>',
permanent: true,
type: 'error'
});
}
$('##ckeditorInstance').hide(900);
return false;
});
|