if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
%> <td>
<script language='JavaScript' type='text/javascript'>
-<% out.print("displayTextEditor('knowledgeValue', '" + kelm.getFullValue() + "', 450, 150);"
+<% out.print("displayTextEditor('knowledgeValue', '" + kelm.getFullValue().replaceAll("[\n\r]","") + "', 450, 150);"
+ "enableRTEvalidation('knowledgeValue');");
%> </script>
</td>
document.writeln('<tbody><tr>');
insertBar();
if(fullscreen || activeCommand.get("save") != null){
- document.writeln('<td><input type="image" class="rteImg" id="'+rte+'SaveButton" src="'+imagesPath+'save.gif" alt="'+lblSave+'" title="'+lblSave+'" onmouseover="this.className=\'rteImgUp\'" onmouseout="this.className=\'rteImg\'" onmousedown="this.className=\'rteImgDn\'" onmouseup="this.className=\'rteImgUp\'" onClick="prepareSubmitEdit(currentRTE)"></td>');
+ document.writeln('<td><input type="image" class="rteImg" id="'+rte+'SaveButton" src="'+imagesPath+'save.gif" alt="'+lblSave+'" title="'+lblSave+'" onmouseover="this.className=\'rteImgUp\'" onmouseout="this.className=\'rteImg\'" onmousedown="this.className=\'rteImgDn\'" onmouseup="this.className=\'rteImgUp\'" onClick="prepareSubmitEdit(\''+rte+'\')"></td>');
nbcommand += 1;
}
if(!isSafari && !isKonqueror) {
//Validation
//*****************
function enableRTEvalidation(rteName) {
- document.getElementById(rteName+'SaveButton').onclick = function(event){
+ document.getElementById(rteName+'SaveButton').addEventListener("click", function(event){
updateRTEs();
field = document.getElementById('hdn'+rteName);
if(field.value != null && (field.value == "" || field.value.replace(/^\s+|\s+$/g,"").length == 0)) {
event.preventDefault();
}
- };
+ });
}
\ No newline at end of file