Hi
I am using 2.4.7 and want to add some javascript to the DOM popup. Basically what I want to happen is that when a certain value in a dropdown box is selected, another field appears (a textfield in this case).
I tried this tutorial but had absolutely no success.
I would be over the moon if someone could give me a hint about it. It is driving me crazy.
Thanks
Edit
My attempts have been as unsuccessful as when I posted this but here is my code anyway.
(function($) {
$(document).ready(function(){
var dropDown = $('#DataObjectManager_Popup_DetailForm_Status');
var reason = $('#DataObjectManager_Popup_DetailForm_Reason');
if(dropDown.val() == 'rejected' || 'Rejected'){
reason.show();
}
else{
reason.hide();
};
dropDown.change(function (e) {
if(dropDown.val() == 'rejected' || 'Rejected'){
reason.show();
alert(dropDown.val())
}
else{
reason.hide();
}
})
});
})(jQuery);
The reason textfield disappears as it is supposed to when I hit save but not when the dropdown is changed.