CL_TYPE

by Craig Martin

HTML

<div>
  <div class="current_logic_cont current_logic_cont_active">Custom Logic Enabled: Saved
    <hr>If answer to this question is <span class="custom_logic_if_answer_to_question_is_rez CLresult custitem_0_cont_7099" id="eid_1_custitem_0_cont_7099">No</span> and the answer to EID# <span class="custom_logic_source_eid_rez CLresult custitem_1_cont_7099"
    id="eid_1_custitem_1_cont_7099">2</span> is <span class="custom_logic_eid_ans_is_rez CLresult custitem_2_cont_7099" id="eid_1_custitem_2_cont_7099">No</span>
    <br>then <span class="custom_logic_then_action_rez CLresult custitem_3_cont_7099" id="eid_1_custitem_3_cont_7099">Stop here</span>
    <hr>If answer to this question is <span class="custom_logic_if_answer_to_question_is_rez CLresult custitem_4_cont_7099" id="eid_1_custitem_4_cont_7099">No</span> and the answer to EID# <span class="custom_logic_source_eid_rez CLresult custitem_5_cont_7099"
    id="eid_1_custitem_5_cont_7099">2</span> is <span class="custom_logic_eid_ans_is_rez CLresult custitem_6_cont_7099" id="eid_1_custitem_6_cont_7099">Yes</span>
    <br>then <span class="custom_logic_then_action_rez CLresult custitem_7_cont_7099" id="eid_1_custitem_7_cont_7099">Pre-fill other select EID#'s</span> if the selected target EID# is <span class="custom_logic_prefill_targ_eid_rez CLresult custitem_8_cont_7099"
    id="eid_1_custitem_8_cont_7099">8</span> Pre-fill the selected target with <span class="prefill_data_type_selection_default_val CLresult custitem_9_cont_7099" id="eid_1_custitem_9_cont_7099">0</span>
    <br>
    <br>then <span class="custom_logic_then_action_rez CLresult custitem_10_cont_7099" id="eid_1_custitem_10_cont_7099">Pre-fill other select EID#'s</span> if the selected target EID# is <span class="custom_logic_prefill_targ_eid_rez CLresult custitem_11_cont_7099"
    id="eid_1_custitem_11_cont_7099">9</span> pre-fill with the answer given for EID# <span class="prefill_data_type_selection_ref_eid CLresult custitem_12_cont_7099"...

JavaScript

var CustomLogic_groupArry = [];
jQuery('.current_logic_cont_active .CLresult').each(function() {

  var customLogicVal = jQuery(this).text();
  if (customLogicVal != '') {

    if (jQuery(this).hasClass('custom_logic_if_answer_to_question_is_rez') == true) {
      var customLogicDesc = 'if_answer_to_this_question_is';
      var customLogicId = jQuery(this).attr('id');
      CustomLogic_groupArry.push({
        CL_type: customLogicDesc,
        CL_value: customLogicVal,
        CL_id: customLogicId
      });
    }

    if (jQuery(this).hasClass('custom_logic_source_eid_rez') == true) {
      var customLogicDesc = 'if_custom_logic_source_eid';
      var customLogicId = jQuery(this).attr('id');
      CustomLogic_groupArry.push({
        CL_type: customLogicDesc,
        CL_value: customLogicVal,
        CL_id: customLogicId
      });
    }

    if (jQuery(this).hasClass('custom_logic_eid_ans_is_rez') == true) {
      var customLogicDesc = 'custom_logic_eid_ans_is';
      var customLogicId = jQuery(this).attr('id');
      CustomLogic_groupArry.push({
        CL_type: customLogicDesc,
        CL_value: customLogicVal,
        CL_id: customLogicId
      });
    }

    if (jQuery(this).hasClass('custom_logic_then_action_rez') == true) {
      var customLogicDesc = 'custom_logic_then_action ';
      var customLogicId = jQuery(this).attr('id');
      CustomLogic_groupArry.push({
        CL_type: customLogicDesc,
        CL_value: customLogicVal,
        CL_id: customLogicId
      });
    }

    if (jQuery(this).hasClass('custom_logic_prefill_targ_eid_rez') == true) {
      var customLogicDesc = 'custom_logic_prefill_targ_eid';
      var customLogicId = jQuery(this).attr('id');
      CustomLogic_groupArry.push({
        CL_type: customLogicDesc,
        CL_value: customLogicVal,
        CL_id: customLogicId
      });
    }

    if (jQuery(this).hasClass('prefill_data_type_selection_default_val') == true) {
      var customLogicDesc =...