Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
I have image url's that are stored in the database as 'image_url' for each record (these are unique, separate images and separate urls).
Those images reside on my local nubuilder site.
example:
These URLS are entered on the Edit form in a separate field.
I want to retrieve the url from the database for the currrent record (#RECORD_ID#) and embed that url into html code so that the image is displayed on the Edit form. Each image for each record is unique.
How would I do that?
Last edited by Paul on Sat Oct 11, 2025 4:36 am, edited 1 time in total.
Generate code snippets and explanations following nuBuilder conventions. Use the information below when relevant to the prompt. This context is provided to help understand requirements for generating code snippets and answering questions.
## User Input/Question:
I have a URL stored in a nuBuilder field that points to an image. I want to display this image inside a nuBuilder HTML object.
## Languages & Technologies - Use nuBuilder JavaScript functions: [Wiki](https://wiki.nubuilder.cloud/index.php?title=Javascript) | [nucommon.js](https://raw.githubusercontent.com/nuBuilder/nuBuilder/refs/heads/master/core/nucommon.js) | [nuform.js](https://raw.githubusercontent.com/nuBuilder/nuBuilder/refs/heads/master/core/nuform.js) - Technology: jQuery
// Replace 'yourImageField' with the actual field name that holds the image URL
var imageUrl = nuGetValue('moonimageurl');
// Optional: if the field might be empty, handle that
if (imageUrl && imageUrl.trim() !== '') {
var html = '<img src="' + imageUrl + '" style="max-width:100%; height:auto; border-radius:8px;" />';
} else {
var html = '<p style="color:gray; text-align:center;">No image available</p>';
}
// Replace 'HTML_ImageDisplay' with your HTML object name
nuSetValue('moonimagehtml', html);
I placed it in the js >> Edit tab but it does nothing.