I've created a form inside a page node type with 4 components :

  • markup
  • select
  • email
  • textarea

All components but select are enclosed in a div tag with specific CSS class and id in HTML rendering :

  • webform-component-markup for markup
  • webform-component-email for email
  • webform-component-textarea for textarea

With such CSS data, adding some javascript behaviour is quite easy. For example show or hide a component is done by applying jQuery function on the desired CSS class :

$(.webform-component-textarea)
.add(.webform-component-email)
.hide();

Lack of the same representation for select component make this task more complex. Furthermore this behavior is not the same as for the other components and may add confusion.

CommentFileSizeAuthor
#1 webform_select_classes3.patch725 bytesquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Active » Fixed
FileSize
725 bytes

We recently applied a patch that was supposed to separate select component classes into "select", "radios", and "checkboxes", but looks like it had variable name problems that were from the 2.x version. I've applied this patch to correct these classes.

Anonymous’s picture

It works !

Thank you !

Status: Fixed » Closed (fixed)
Issue tags: -CSS class form components

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