Dear GreyHead,
ChronoForm is an amazing and non-dispensable component for Joomla!
But I can't figure out how to load image from database into a Chronoform. Suppose I have a ChronoForm called "edit", which will load a row record from database table and populate the values into respective form fields. I have "DB loader" and (above) "Show Html" actions. I also set "Load Use Model ID" (e.g. Model ID is "Record") to "Yes" so that I have more control on the record data. There seems no "Image" element so I drag and use a custom element in the form. To make sure I can get the row record, I temporarily added "Custom Code" action into the form events panel, just between "DB Loader" and "Show Html", and
did display the correct value!
The problem occurs when I tried to pass the value (e.g. "$form->data['Record']['ImagePath']") to src attribute value in img, by using
The src value is missing always so I didn't see any images loaded.
I also tried other methods, such as using JavaScript to get value from PHP and dynamically set the src value for img tag, but it is not working either.
Does anybody have idea of how to achieve this? I really appreciate any suggestions!!!
Thank you all in advance!
ChronoForm is an amazing and non-dispensable component for Joomla!
But I can't figure out how to load image from database into a Chronoform. Suppose I have a ChronoForm called "edit", which will load a row record from database table and populate the values into respective form fields. I have "DB loader" and (above) "Show Html" actions. I also set "Load Use Model ID" (e.g. Model ID is "Record") to "Yes" so that I have more control on the record data. There seems no "Image" element so I drag and use a custom element in the form. To make sure I can get the row record, I temporarily added "Custom Code" action into the form events panel, just between "DB Loader" and "Show Html", and
<?php echo $form->data['Record']['ImagePath']; ?>
did display the correct value!
The problem occurs when I tried to pass the value (e.g. "$form->data['Record']['ImagePath']") to src attribute value in img, by using
<img src="<?php echo $form->data['Record']['ImagePath']; ?>" alt="image" />
The src value is missing always so I didn't see any images loaded.
I also tried other methods, such as using JavaScript to get value from PHP and dynamically set the src value for img tag, but it is not working either.
Does anybody have idea of how to achieve this? I really appreciate any suggestions!!!
Thank you all in advance!