Searching records
";
});
listHtml += '
';
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--bycert").html(listHtml);
} else {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--bycert").css("display","none");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--byclient").css("display","block");
// console.log(data);
data = data.Certificates;
if (data.length == 0) {
var linkHtml = "
Found "+ data.length + " records
";
}
else if (data.length == 1 ) {
var linkHtml = "
Found "+ data.length + " record
";
} else {
var linkHtml = "
Found "+ data.length + " records
";
}
linkHtml += "
"
linkHtml += ""
linkHtml += ""
linkHtml += "Registrant Name | "
linkHtml += "Standard | "
linkHtml += "Certificate Number | "
linkHtml += "Certification Date | "
linkHtml += "Expiration Date | "
linkHtml += "
"
linkHtml += ""
linkHtml += ""
for (var i=0; i"+ data[i].registrant + " | " + data[i].standard + " | " + data[i].certificateNumber + " | " + data[i].issueDate + " | " + data[i].expirationDate + " | ";
}
linkHtml += "
";
// console.log(linkHtml);
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--byclient").html(linkHtml);
$("#hs_cos_wrapper_widget_1619098562024 .certDetailsLink").click(function(e){
var id = this.id;
buildResultList_widget_1619098562024(data[id], true);
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--bycert").prepend("
Back to List");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--back").click(function(e){
console.log("returning to list");
$("#hs_cos_wrapper_widget_1619098562024 .certContainer").remove();
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--bycert").css("display","none");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--byclient").css("display","block");
e.preventDefault();
});
e.preventDefault();
});
}
}
function displayError_widget_1619098562024(msg) {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--data").css("display","none");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--error").css("display","block");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--error").html("
"+msg+"
");
}
function validateForm_widget_1619098562024() {
certNum = $("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input").val();
certClient = $("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").val();
if (certNum.length 0 && certClient.length > 0) {
console.log("form invalid - data in both fields");
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input, #hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").addClass("section--isodirectory--input--error");
displayError_widget_1619098562024("Invalid input: Only one input field can be populated.");
return false;
} else if (certNum.length >= 4 || certClient.length >= 4) {
if (certNum.length > 0) {
searchByNumber = true;
} else {
searchByNumber = false;
}
return true;
} else if (certNum.length An unexpected error occured, please try again.");
} else {
var responseText = JSON.parse(response.responseText);
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--error").html("
"+responseText.message+"
");
}
});
} else {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--loading").css("display","none");
}
}
function getQueryVariable_widget_1619098562024(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i
3) {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input, #hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").removeClass("section--isodirectory--input--error");
}
if ($(this).val().length==0) {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input, #hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").removeClass("section--isodirectory--input--error");
}
}
});
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input, #hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").on('click',function() {
console.log($(this).val());
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input, #hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certclient--input").removeClass("section--isodirectory--input--error");
});
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--form").submit(function (e) {
loadData_widget_1619098562024();
e.preventDefault();
});
var queryParam_widget_1619098562024 = getQueryVariable_widget_1619098562024("certificateNumber");
if (queryParam_widget_1619098562024 !== false) {
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--certnumber--input").val(queryParam_widget_1619098562024);
$("#hs_cos_wrapper_widget_1619098562024 .section--isodirectory--form").submit();
} else {
}