Relevant ID

by dixalex

HTML

<div id='comment_cm1'>

</div>

CSS

input {
    display: block;
    visibility: visible;
}

div {
    width: 250px;
    height: auto;
    border: solid 1px green;
    text-align: center;
}

form,
input {
    width: 98%;
    margin: 0 auto;
}

JavaScript

var relevantArray = ["ClientID", "RelevantID", "PanelistID", "SurveyID", "PropertyList", "RequestCSOData", "RVIDCompleted", "GeoCodes", "CID", "TID", "VID", "TimePeriod", "RVid", "isNew", "Score", "GeoIP", "Country", "OldId", "OldIDDate", "CompleteFlag", "CompleteDate", "ScreenoutFlag", "ScreenoutDate", "TotalCompletes", "CSOPanelistID", "CSOPanelistIDDate", "CSOPanelistIDStatus", "Domain", "FraudProfileScore", "FPF1", "FPF2", "FPF3", "FPF4", "FPF5", "FPF6", "FPF7", "FPF8", "FPF9", "RVIDHash2", "isMobile", "txtResult"];

var relevant_form = document.createElement('form');

jQuery(relevantArray).each(function(k, v) {
    var cachedID = v;
    var new_input = document.createElement('input');
    new_input.type = 'hidden';
    new_input.id = cachedID;
    new_input.name = cachedID;

    if ((cachedID === 'RequestCSOData') || (cachedID === 'RVIDCompleted')) {
        new_input.value = 0;
    }

    relevant_form.appendChild(new_input);
});

jQuery('#comment_cm1').append(relevant_form);


//$.getScript(('https:' == document.location.protocol ? 'https://d3op16id4dloxg.cloudfront.net/RVIDWrapperAjax3.js' : 'http://relevantid.imperium.com/RVIDWrapperAjax3.js'))
//.done(function(script, textStatus) {
//callRVIDService();
// })
// .fail(function(jqxhr, settings, exception) {
//do nothing
//   });
//$('#comment_cm1').css('display', 'none');
//$('#question_relID').css('display', 'none');