quatalog-site/js/search_helper.js
3eef8a28f26fb2bcc514e6f1938929a1f931762 a34a9d923d Start working on search
2024-03-16 15:22:34 -04:00

17 lines
738 B
JavaScript

const search_helper = function() {
const input = document.getElementById("search").value;
console.log(input);
/*
const courseCodeInput = elem.value.replace(" ", "").replace("-", "");
const subCode = courseCodeInput.substring(0,4).toUpperCase();
const courseNum = courseCodeInput.substring(courseCodeInput.length-4,courseCodeInput.length);
if(`${subCode}-${courseNum}` in catalog){
// course exists
window.location.href = "./coursedisplay.html?course="+subCode+"-"+courseNum;
} else {
// course doesn't exist
window.location.href = "./search.html?search="+encodeURIComponent(elem.value);
showSearchResults();
}*/
}