Programmatically change the value of an image field in the detail view

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:

But if your field is an image field, the above code won’t work. Try this instead:

Of course, change fieldname in the above code to the actual field name.

Published by Genedy

I'm the founder of BigProf Software. We're a tiny team of developers who create tools that make it easy (and affordable) for anyone to create connected business applications that work from any device with a browser.