Closed (fixed)
Project:
ImageField
Version:
6.x-3.9
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2011 at 02:43 UTC
Updated:
9 Feb 2011 at 19:58 UTC
What is the best way to determine, by looking through the DOM, whether an imagefield is empty?
Currently, I look for <div class='imagefield-preview'> to determine whether the imagefield is empty:
if ($(this).find('div.imagefield-preview')){
imagefield_is_empty = false;
} else {
imagefield_is_empty = true;
}
But I am wondering ... is there a better way?
Thanks.
Comments
Comment #1
quicksketchThis seems like a reasonable approach, though I think the way I'd go about it is by checking the FID stored in the hidden field (if it's greater than 0, there is a file).
Comment #2
kobnim commentedThank you!!
Comment #3
quicksketch