Page 1 of 1

copy the currently selected content type

Posted: 25 Aug 2017
by RMIC
Hello,

How can I copy the currently selected content type to a text column in a form via Javascript. I have tested the following, but it does not work:

var contenttype_new = fd.field('ContentType').control()._el().find('selected');
var contenttype_new = fd.field('ContentType').control()._el().text();

fd.field('copy_contenttype').value(contenttype_new);

Can you help me?
Thanks!

Re: copy the currently selected content type

Posted: 25 Aug 2017
by Nikita Kurguzov
Hello!
Try this:

Code: Select all

fd.field('ContentType').control()._el().find(":selected").text();

Re: copy the currently selected content type

Posted: 28 Aug 2017
by RMIC
It works.

Many Thanks!