0

Hi I would like to offer a toggle show/hide for some fields that are not mandatory. Is there is a modules for this or would it be a case of using a template and jquery.

  • jQuery will well for this: (function($) { $(document).ready(function() { $('#select1').change(function() { switch ($(this).val()) { case '1': $('#field2').hide(); break; default: $('#field2').show(); break; } }); }); }) (jQuery); You can also try Conditional Field module but it is in development. – Andrew Welch Sep 19 '12 at 12:40
  • why you put shyghar answer as accepted answer? his answer have not any mention of jquery. – Yusef Sep 19 '12 at 15:17
  • the person who added the jquery answer, did it whilst I was reading the other answers, and then deleted it after I marked the answer. – Andrew Welch Sep 20 '12 at 20:08
1

You can put the not mandatory field in a group installing Field Group. The group have a 'collapsible' option.

1

You can Put your fields toghether with Field Group Module ,and after it you can show/hide it(field groups) by custom jquery code.

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.