I'am trying to change the text of field description in detail view based on the selection of user in dropdown list. I've make some jquery code and put it on tablename-dv.js. Unfortunately it doesn't work.
But if I put the code in console, it work. But if I change another dropdown list, it fail to work again.
What is the problem. Can somebody help?
Thank you
This is the code:
Code: Select all
$j(function () {
$j('#s2id_bidang-container > a > span').on('DOMSubtreeModified',function(){
if ($j(this).text() == 'KanBA' || $j(this).text() == 'KanPIPQ') {
$j('#perancangan-description > div').text('A. KANDUNGAN (ASPEK PERANCANGAN PEMBELAJARAN & PEMUDAHCARAAN, PDPC)');
} else if ($j(this).text() == 'PedBA' || $j(this).text() == 'PedPIPQ') {
$j('#perancangan-description > div').text('A. PEDAGOGI (ASPEK PERANCANGAN PEMBELAJARAN & PEMUDAHCARAAN, PDPC)');
};
});
});