When I create an image field of type "Image" with CCK and mark it as "Required," it is not marked with class="form-required" in the HTML, and thus does not receive the "*" Required item styling. However, when the field isn't filled in and the form is processed, an error message stating that that field is required is received. In this case the text box doesn't have the red outline styling it should at this point either (because again it doesn't have class="form-required"). This is true whether the image is in a group or not, whether or not multiple values are allowed, and whether or not custom alt and title text is enabled.

Comments

drewish’s picture

Project: Image » ImageField
Version: 5.x-1.6 » 5.x-1.x-dev
Component: image.module » Code

not an image module issue.

abloodworth’s picture

Any idea which module it would be? I'd be happy to try to fix the problem if I knew where to look...

moshe weitzman’s picture

Status: Active » Closed (fixed)

it is a core issue. when fapi was introduced, we could not easily make any fields fields required. it has to do with how browsers protect file fields for your security.

abloodworth’s picture

In your previous post, did you mean to say "could not easily make any image fields required"? Because this is working fine for non-image fields. This is a major user experience issue; if a field is required, you need to be able to tell a user this up-front, not wait for an error message. I guess the work-around is to somehow indicate this in a customized template for this content type?