inside a multigroup (one of the mayor changes in the 3.x version) I create a combobox, that in a specific value raise (most show) another field in the multigroup (a text field). It doesn't work, the second field (the text field) are always visible.

Comments

markus_petrux’s picture

Component: fieldgroup.module » content_multigroup.module
Assigned: neopulse » Unassigned
Status: Active » Closed (duplicate)

This is reported in the Conditional Fields queue: #357506: Compatibility with CCK 3x multigroup

bakr’s picture

I have gone the thread but no solution.... so I have created my own:

Work Perfectly for me, but you have to adapt it....

var matching_url = (byName.search("/edit"));
var matching_url2 = (byName.search("/add"));
if (matching_url > -1 || matching_url2 > -1) {
	$(document).ready(function () {
		// Prepare Master Parameters ************************************************************************************
		function multigroupLookTicker() {
			setTimeout(function () {
				multigroupLook()
			}, 1000)
		}

		function multigroupLook() {
			$("table#group_who_was_involved_values.content-multiple-table.content-multigroup-edit-table-single-column.sticky-enabled.tabledrag-processed.sticky-table.content-remove-buttons-processed tbody tr").each(function (key, value) {
				console.log("-------")
				//	console.log( key + ": " + value );
				// controlling field names...
				var Involved_status = "Select#edit-group-who-was-involved-" + key + "-field-involoved-person-status-value";
				// controlled field names ...
				var Involved_JobTitle = "Input#edit-group-who-was-involved-" + key + "-field-involved-person-jobtitle-value";
				var Involved_Organization = "Input#edit-group-who-was-involved-" + key + "-field-involved-person-org-value";
				// console.log(Involved_Name)
				// --------------------------------------------------
				if ($(Involved_status).val() == "Employee") {
					$(Involved_JobTitle).parent().fadeIn()
					$(Involved_Organization).parent().fadeOut()
				}
				// ---------------------------------------------------
				if ($(Involved_status).val() == "Contractor") {
					$(Involved_JobTitle).parent().fadeOut()
					$(Involved_Organization).parent().fadeIn()
				}
				// --------------------------------------------------
				if ($(Involved_status).val() == "" || $(Involved_status).val() == "Other Person" ) {
					$(Involved_Organization).parent().fadeOut()
					$(Involved_JobTitle).parent().fadeOut()
				}
			});
			// ===================================
			setTimeout(function () {
				multigroupLookTicker()
			}, 1000)
			// ==================================
		}
		multigroupLook()
		$("input#edit-group-who-was-involved-group-who-was-involved-add-more.form-submit").live("click", function () {
			multigroupLook()
		});
		$("body").live("click", function () {
			multigroupLook()
		});
	}); // end of: $(document).ready(function() ...
} // closing: if (matching_url > -1)