CL_TYPE fork RC3
by Craig Martin
HTML
<ol>
<div id="item_7688" class="verdictformyes-no lineitem" style="background: rgb(255, 255, 255);">
<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_7675" data="0" data_eid="1" id="eid_1_custitem_0_cont_7675" data_index="0">Yes</span> and the answer to EID# <span class="custom_logic_source_eid_rez CLresult custitem_1_cont_7675"
data_eid="1" id="eid_1_custitem_1_cont_7675" data_index="1">2</span> is <span class="custom_logic_eid_ans_is_rez CLresult custitem_2_cont_7675" data_eid="1" id="eid_1_custitem_2_cont_7675" data_index="2">No</span> <br>then <span class="custom_logic_then_action_rez CLresult custitem_3_cont_7675"
data_eid="1" id="eid_1_custitem_3_cont_7675" 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_7675" data_eid="1" id="eid_1_custitem_4_cont_7675"
data_index="4">9</span> pre-fill with the answer given for EID# <span class="prefill_data_type_selection_ref_eid CLresult custitem_5_cont_7675" data_eid="1" id="eid_1_custitem_5_cont_7675" data_index="5">8</span></div>
<div style="display:none;"
class="straw_vote_result" id="straw_vote_result_7688"></div>
<p class="question" style="display: none;"></p>
<div class="numbox_cont">
<li class="numbox"> Was Donna Doe negligent? </li>
</div>
<p style="display: none;"></p>
<p class="answercont"><select class="required" id="7688" required=""><option value="" disabled="" selected="">Select: Yes or No...</option><option value="Yes">Yes</option><option value="No">No</option></select></p><span class="answercont"><span class="qidval">7688</span></span>
<span
class="ftcont"><input class="form_type" type="hidden" name="form_type" value="VF-400"></span><span class="hidden"...
CSS
#formcont div p:nth-child(1),
#formcont div p:nth-child(2) {
/*
display: inline;
*/
}
#sigpadbtn {
background: #3498DB !important;
padding: 8px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
border: none;
color: #fff;
font-size: 20px;
font-family: play;
transition: .8s;
margin-left: 40px;
}
.btn-normal {
background: #3498DB !important;
padding: 8px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
border: none;
color: #fff;
font-size: 14px;
font-family: play;
transition: .8s;
}
.btn-normal:hover {
background: #2973a5 !important;
color: #fff;
}
#sigcont {}
.sig {
padding-left: 33px !important;
}
#saveallcont2 {
padding: 8px 0 0px 0;
bottom: -8px;
margin: 0px 0;
width: 100%;
text-align: center;
left: 0;
z-index: 2;
font-size: 17px;
line-height: 1.3em;
position: fixed;
border: rgba(39, 56, 181, 0.92);
background: rgb(60, 60, 62);
-o-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.3), inset 0 10px rgba(255, 255, 255, 0.2), inset 0 10px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 30px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.3), inset 0 10px rgba(255, 255, 255, 0.2), inset 0 10px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 30px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 1px rgba(255, 255, 255, 0.3), inset 0 10px rgba(255, 255, 255, 0.2), inset 0 10px 20px rgba(255, 255, 255, 0.25), inset 0 -15px 30px rgba(0, 0, 0, 0.3);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), /* Exterior Shadow; inset 0 1px rgba(255, 255, 255, 0.32), /* Top light Line */
inset 0 10px rgba(255, 255, 255, 0.03), /* Top Light Shadow */
inset 0 10px 20px rgba(255, 255, 255, 0.25), /* Sides Light Shadow */
inset 0 -15px 30px rgba(0, 0, 0, 0.26);
color:...
JavaScript
CL_linked_arr = [];
function ParseCustomLogic(qid, Qtype, Qanswer, recheck, thisqid) {
//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');
var CL_rules_arr = [];
//var CL_linked_arr = [];
CL_linked_index = CL_linked_arr.indexOf(jQuery('#item_' + qid));
if (CL_linked_index == '-1') {
CL_linked_arr.push(jQuery('#item_' + qid).attr('id').replace(/[^0-9]+/g, ''));
//alert(jQuery('#item_'+qid).attr('id').replace(/[^0-9]+/g, '')+' :thi CL_linked_index: '+CL_linked_index);
}
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');
customLogicAnswerIs = jQuery(this).text();
//alert('if this answer is: '+customLogicAnswerIs);
if_cur_answer_is = customLogicAnswerIs;
condition_is = 'false';
fillsourceid = 'none';
CL_rules_arr.push({
qid: qid,
curQIDval: curQIDval,
if_cur_answer_is: if_cur_answer_is
});
} //end If answer to this question is this val
//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();
LSeideq = custom_logic_source_eid_rez - '1';
sourceid = jQuery(".lineitem :eq(" + LSeideq +...