Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've created a form inside a page node type with 4 components :
- markup
- select
- 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.
Comment | File | Size | Author |
---|---|---|---|
#1 | webform_select_classes3.patch | 725 bytes | quicksketch |
Comments
Comment #1
quicksketchWe 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.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedIt works !
Thank you !