CL_TYPE fork RC1
by Craig Martin
HTML
<div>
<br> TEMP:
<br>
<div id="temp"></div>
<br>
<div id="temp2"></div>
<br>
<div id="custom-log"></div>
<ol>
<div id="item_7099" class="verdictformyes-no lineitem" style="background: rgb(208, 208, 208);">
<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_7253" data="0" data_eid="1" id="eid_1_custitem_0_cont_7253" data_index="0">No</span>
and the answer to EID#
<span class="custom_logic_source_eid_rez CLresult custitem_1_cont_7253" data_eid="1" id="eid_1_custitem_1_cont_7253" data_index="1">2</span>
is <span class="custom_logic_eid_ans_is_rez CLresult custitem_2_cont_7253" data_eid="1" id="eid_1_custitem_2_cont_7253" data_index="2">Yes</span>
<br>then
<span class="custom_logic_then_action_rez CLresult custitem_3_cont_7253" data_eid="1" id="eid_1_custitem_3_cont_7253" data_index="3">Pre-fill other select EID#'s</span>
if the selected target EID# is
<span class="custom_logic_prefill_targ_eid_rez CLresult custitem_4_cont_7253" data_eid="1" id="eid_1_custitem_4_cont_7253" data_index="4">8</span>
Pre-fill the selected target with
<span class="prefill_data_type_selection_default_val CLresult custitem_5_cont_7253" data_eid="1" id="eid_1_custitem_5_cont_7253" data_index="5">0</span>
<br><hr>
If answer to this question is
<span class="custom_logic_if_answer_to_question_is_rez CLresult custitem_6_cont_7253" data="9" data_eid="1" id="eid_1_custitem_6_cont_7253" data_index="6">No</span>
and the answer to EID#
<span class="custom_logic_source_eid_rez CLresult custitem_7_cont_7253" data_eid="1" id="eid_1_custitem_7_cont_7253" data_index="7">2</span>
is <span class="custom_logic_eid_ans_is_rez CLresult custitem_8_cont_7253" data_eid="1" id="eid_1_custitem_8_cont_7253" data_index="8">No</span>
<br>then
<span class="custom_logic_then_action_rez CLresult custitem_9_cont_7253"...
JavaScript
function ParseCustomLogic(qid, Qtype, Qanswer) {
//alert(qid+', '+Qtype+', '+Qanswer);
var curQIDval = jQuery('#' + qid).val();
if (curQIDval == 'Yes') {
var valType = 'Yes';
}
if (curQIDval == 'No') {
var valType = 'No';
}
if (curQIDval != 'No' && curQIDval != 'Yes') {
var valType = 'number';
}
curEID = jQuery('#item_'+qid).index('.lineitem');
jQuery('#item_' + qid + ' .current_logic_cont .CLresult').each(function() {
var thisVal = jQuery(this).text();
if (thisVal != '') {
//If answer to this question is this val
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');
var customLogicAnswerIs = jQuery(this).text();
//alert('if this answer is: '+customLogicAnswerIs);
if_cur_answer_is = customLogicAnswerIs;
condition_is = 'false';
fillsourceid = 'none';
}
//target eid is this eid#
if (jQuery(this).hasClass('custom_logic_source_eid_rez') == true) {
var customLogicDesc = 'if_custom_logic_source_eid';
var customLogicId = jQuery(this).attr('id');
custom_logic_source_eid_rez = jQuery(this).text();
eideq = custom_logic_source_eid_rez - '1';
sourceid = jQuery(".lineitem :eq(" + eideq + ")").attr('id').replace(/[^0-9]+/g, '');
sourceval = jQuery('#' + sourceid).val();
curval = jQuery('#' + qid).val();
curvalEIDnum = eideq;
sourceselected = sourceval; //get target current val
}
//linked eid answer is this
if (jQuery(this).hasClass('custom_logic_eid_ans_is_rez') == true) {
var customLogicDesc = 'custom_logic_eid_ans_is';
var customLogicId = jQuery(this).attr('id');
custom_logic_eid_ans_is_rez = jQuery(this).text();
custom_logic_eid_ans_is_ID = jQuery(this).attr('id');
if (sourceselected ==...