This isn't happening on all my node create forms, but specifically one with a Node Reference field, while using the Node Reference URL Widget.

The label and text field for "Leave this field blank" are visible after I submit the form with a required field as blank.

Any ideas?

Comments

geerlingguy’s picture

Probably has to do with the way I'm attaching the CSS. I might need to attach the CSS via an accessory function (in an #after_build function) rather than using drupal_add_css() inside honeypot_add_form_protection().

Won't have time to look into this for a few days, probably a couple weeks, but hopefully I'll get some time soon (otherwise, if someone else wants to take a crack at it, be my guest :).

jarchowk’s picture

I don't a lot of time either at the moment. Is this something I can put a band-aid on by hiding in my general css files, or would that be caught by spam bots?

geerlingguy’s picture

If you move that CSS rule to your general CSS, it should help in the interim, and shouldn't make spam bots any different.

patrick r.’s picture

Status: Active » Needs review
StatusFileSize
new705 bytes

You need to make use of the #attached key instead of drupal_add_css.

geerlingguy’s picture

Ah, yes, forgot about #attached in Drupal 7 (though, even with #attached, I've sometimes found the file goes away for some weird reason). Anyways, will check out this patch soon and RTBC. I really need to take a few hours and commit some of these patches, but it'll probably have to wait until a Saturday.

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

Works great! I'm going to commit the patch in a few minutes.

geerlingguy’s picture

Status: Reviewed & tested by the community » Fixed
geerlingguy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Needs review
StatusFileSize
new1.09 KB

Bumping to 6.x. Attached patch should help in 6.x (using a #pre_render callback in D6, since there's no #attached property for forms like in D7).

Status: Needs review » Needs work

The last submitted patch, 1578110-8-d6-form-css.patch, failed testing.

geerlingguy’s picture

Status: Needs work » Needs review
geerlingguy’s picture

#8: 1578110-8-d6-form-css.patch queued for re-testing.

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed patch, and it works perfectly, even with validation failures.

geerlingguy’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.