Collapse Appended Text for Multiple Line text field
We have a MultipleLine textfield in which we set the "Append Changes to Existing Text" option to "Yes."
It works great, but there are many appended Comments and so the form ist very long and not so useful.
Is there a way to collapse each comment in the Form?
It works great, but there are many appended Comments and so the form ist very long and not so useful.
Is there a way to collapse each comment in the Form?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
I've made the assumption you're asking about the enhanced rich text multiline textbox. You can use an accordion for this. Add this code to the JS editor of your form:
And replace 'multiline' in fd.field('multiline') with the internal name of your multiline field.
This should produce something looking like this:
More information on the accordion control, how you can customize it: http://api.jqueryui.com/accordion/
Code: Select all
fd.field('multiline').control()._el().find("> div").attr('class', 'comments-collapsible').find(" > div[class^='ExternalClass']").each(function(){
var html = "<h3>" + $(this).text().substring(0,60) +"</h3>";
$(this).before(html);
});
$('.comments-collapsible').accordion({
collapsible: true,
active: false
})
And replace 'multiline' in fd.field('multiline') with the internal name of your multiline field.
This should produce something looking like this:
More information on the accordion control, how you can customize it: http://api.jqueryui.com/accordion/
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests