Rich Text Editor Didnt Save Data in Table (Joget Version 6)

Confluence User - 05 Apr, 2021

Hi,


Is there different compability? When submit data for Rich Text Editor input for subform table, it didnt work. Data didnt save. Before this, using Joget v4 and v5 works fine. After upgrade to v6 i faced this issue. Text area and input fields just working fine.


<script>

$(document).ready( function(){

$('#assignmentComplete,#submit').click(function() {

$('[name$=LogRemark]').val($('[name$=log_remark]').val());  <------ here the column for rich text editor

$('[name$=LogStatus]').val($('[name$=status]').val());

$('[name$=LogPosition]').val($('[name$=Position]').val());

});

});

</script>

forms;userviews;user

4


05 Apr, 2021
confluenceUser
confluenceUser

Hi,

I think something is wrong with your jquery selector. It's missing double quote :

$('[name$="LogRemark"]').val($('[name$="log_remark"]').val()); 

05 Apr, 2021
confluenceUser
confluenceUser

This works fine on Joget v4 and v5.


<script>

$(document).ready( function(){

$('#assignmentComplete,#submit').click(function() {

$('[name$=LogRemark]').val($('[name$=log_remark]').val()); <------ here the column for rich text editor

$('[name$=LogStatus]').val($('[name$=status]').val());

$('[name$=LogPosition]').val($('[name$=Position]').val());

});

});

</script>


On Joget v6 only the column with rich text editor input didnt work (only submit blank input). other input just working fine.

07 Apr, 2021
confluenceUser
1
confluenceUser

I had to look up https://www.tiny.cloud/blog/how-to-get-content-and-set-content-in-tinymce/ to use their script to get the RTE value, and got this working in Joget v6 and DX. The code is in two parts:

  • 1st part gets the "data-id": FormUtil.getField("RichTextField").attr("id")
  • 2nd part pass the data_id to tinymce.get() function call: tinymce.get( "[data_id_value]" ).getContent();

You can then use the return value from 2nd part to assign to another form field (The field is "Copy" in this example).

<script>
$(document).ready( function(){
	$('#assignmentComplete, #submit').click(function() {
		var rteValue = tinymce.get( FormUtil.getField("RichTextField").attr("id") ).getContent();
		$('[name$=Copy]').val( rteValue );
	});
});
</script>
13 Apr, 2021
confluenceUser
confluenceUser

Tq very much! Its working.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print