By rafuel92 on
Hi, i have a field collection with five fields inside, i need that when one field is checked another field is hidden. I want to use a drupal behavior to attach my event to every new field collection item generated at the press on the "add another item" button.
(function ($) {
function vedi_se_nascondere(){
if ($("#edit-field-istruzione-e-formazione-und-0-field-ancora-in-corso-istr-und").is(":checked"))
{ //this is the div wrapper that i need to hide
$("#field-istruzione-e-formazione-und-0-field-data-fine-formazione-add-more-wrapper").hide("fast");
}
else
{
$("#field-istruzione-e-formazione-und-0-field-data-fine-formazione-add-more-wrapper").show("fast");
}
}
Drupal.behaviors.miotema = {
attach: function(context) {
//my boolean field
$("#edit-field-istruzione-e-formazione-und-0-field-ancora-in-corso-istr-und").click(function(){
vedi_se_nascondere();
});
}
};
})(jQuery);
can you help me? thanks in advice
Comments
Hello! I need too!
That is exactly what I need to! Have anyone here? Please help!
Hi, i solved it adding this
Hi, i solved it adding this js file to my omega subtheme, hope that this will solve your problem :)
Add another field
is anyone knows , where it is exactly came from core, i mean which js