0

How can I add a CCK field that has a checkbox and a textfield in Drupal 6? so I want to have something like this:

[x] Option1 _______________
[ ] Option2 _______________
[ ] Option3 _______________
[x] Option4 _______________
0

Just define 4 checkboxes and 4 textfields. If you use a bit of CSS you can get them to look like they're compound fields by floating left and clearing after the textfields. You might need to hook into the validate functions (using hook_form_alter) if you want these fields to be any smarter than that.

  • Another way to help with the display is to put each pair of fields (checkbox and text field) in their own field group. – Malks Feb 5 '12 at 4:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.