should this work with multiple-value checkboxes?
brad bulger - April 13, 2008 - 00:30
| Project: | Dependent Fields |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
i thought it would from how i read the description but it does not seem to. i can't get it to work for anything except a Single on/off checkbox. for any other kind of parent field, the child fields are displayed above the parent and changing the parent field value does nothing. no javascript errors. i tried saving the file as HTML and editing it directly, and it seems to only pay attention to the first 'this_is_a_parent' div - since it looks like it is going to the previous 'form-item' in the page to find the parent, i tried putting two of them in after each individual checkbox form-item div, with the proper respective parent_text values.

#1
Please export your cck content type and define what other modules are installed.
#2
i set up a new vanilla drupal 5.7 installation with just CCK and dependent:
cck-5.x-1.6-1.tar.gz
dependent-5.x-1.3-beta.tar.gz
drupal-5.7.tar.gz
all the modules that come with CCK are installed
i made a new content type with a multiple-value checkbox, a radio-button field, and a single-checkbox field, with text fields dependent on all of these. only the single-checkbox field is working for me.
i'm attaching a tarball with the export of the CCK type and a copy of the create content screen - the styles don't work in it but the javascript does, so you can see what i'm talking about, i hope.
thanks for checking this out
#3
ah! found it. it was because i was using the "value|label" format for my allowed values - 'red|Red' instead of just 'Red'. just 'Red' works fine.
i'm attaching a patch - it is probably not the best way to actually fix this but it gets it working for now.
.
#4
updating ticket status to reflect reality as i know it...
#5
OK. It seems the code added is a good solution. I'll add it to the next release.
#6
This patch didn't work for me - I was using a select list with key|value options.
Here is a simpler patch that worked for me for key | values pairs.
Essentially it is the same thing using a split which I think is more efficient.