I'm using float left for forms.
When first load, css added. but when submitted without fill inputs css not included.

CommentFileSizeAuthor
submitted.JPG19.89 KBmehmetali
first load.JPG16.84 KBmehmetali

Comments

joachim’s picture

Version: 6.x-2.0 » 6.x-2.2

I am seeing this bug too.

joachim’s picture

I'm guessing this is because on validation the form is retrieved from the cache and the form builder function -- where the CSS gets added -- is not called.

joachim’s picture

The trick is to put the drupal_add_css() call in your form's theme function.

Found this: http://www.appnovation.com/drupaladdjs-and-drupaladdcss-hookformalter-an...

This is thus probably a works-as-designed, though some documentation in the example module about this is needed.

joachim’s picture

Title: Submit when not filled required areas drupal_add_css skiping » CSS not loaded for form validation errors - drupal_add_css skipped

Clearer title.

bneel’s picture

Simply add you drupal_add_css in your validation callback.