In the detail view, if you have some ajax request running in the background that should update your detail view form (or if you do this in the tablename_dv hook), you might already know that you can change the data of a normal text field using this JavaScript code:
1 |
$j('#fieldname').val('new value'); |
But if your field is an image field, the above code won’t work. Try this instead:
1 |
$j('#fieldname-image').attr('src', './images/new-image.png'); |
Of course, change fieldname in the above code to the actual field name.