function updateModalEditConnectionFields(p_disable_list, p_enable_list, p_form_cases) {
	// Disabling elements.
	for (let i = 0; i < p_disable_list.length; i++) {
    var v_item = document.getElementById(p_disable_list[i]);
    v_item.setAttribute('readonly',true);
		v_item.setAttribute('disabled', true);
    v_item.value = null;
  }
	// Enabling elements.
  for (let i = 0; i < p_enable_list.length; i++) {
    var v_item = document.getElementById(p_enable_list[i]);
    v_item.removeAttribute('readonly');
		v_item.removeAttribute('disabled');
  }
	// Removing 'required' class from elements inside the connection modal.
	$('#modal_edit_connection .required').removeClass('required');
	let v_has_invalid = false;
	if (p_form_cases) {
		// Adding 'required' class to required elements inside.
		for (let i = 0; i < p_form_cases.length; i++) {
			$('#'+p_form_cases[i]).parent().addClass('required');
		}
		// Validating values of required elements.
		for (let i = 0; i < p_form_cases.length; i++) {
			if (p_form_cases[i] === 'conn_form_type') {
				if (document.getElementById(p_form_cases[i]).value === '-1') {
					v_has_invalid = true;
					break;
				}
			}
			else {
				let v_value_check = document.getElementById(p_form_cases[i]).value.trim();
				if (v_value_check === '' || v_value_check === null) {
					v_has_invalid = true;
					break;
				}
			}
		}
	}
	// Enabling or Disabling the test and save buttons based on valid data of required fields.
	if (v_has_invalid) {
		document.getElementById('conn_form_button_test_connection').setAttribute('disabled', true);
		document.getElementById('conn_form_button_save_connection').setAttribute('disabled', true);
	}
	else {
		document.getElementById('conn_form_button_test_connection').removeAttribute('disabled');
		document.getElementById('conn_form_button_save_connection').removeAttribute('disabled');
	}

}
## updateModalEditConnectionFields
@desc Verifies a set of arrays to either disable, enable, set as required and clear fields when necessary.

@param  {array} p_disable_list IDs of elements that should be disabled.
@param  {array} p_enable_list  IDs of elements that should be enabled.
@param  {array} p_form_cases   IDs of elements that should be required.