window.notificationMessages = []; Find a Job + + + + Search const TopSearch = {
handleSubmit: function (event) {
event.preventDefault();
event.stopPropagation();
const form = event.target;
const getValue = (name) => {
if (form[name]) {
if (form[name].type) {
if (["select-one", "text", "hidden"].indexOf(form[name].type) > -1) {
return form[name].value;
}
if (["checkbox", "radio"].indexOf(form[name].type) > -1 && form[name].checked) {
return form[name].value;
}
} else if (form[name].length) {
return form[name].value;
}
}
return "";
};
const experienceLevel = getValue("experience[]") || getValue("experience");
const jobFunction = getValue("job_function[]") || getValue("job_function");
const industry = getValue("industry[]") || getValue("industry");
const location = getValue("location[]") || getValue("location");
const workType = getValue("work_type");
const term = getValue("q");
const sortBy = getValue("sort_by");
// If the logged in user is authenticated
// Append authenticated value to make url unique/different to logged out url
// same action is happening in SearchFilterViewComposer
// line 589 in the multiSearchFilterHref function
const authenticated = document.getElementById("authenticated").value;
let toUrl = "";
if (industry.trim() && jobFunction.trim()) {
const segments = [jobFunction, location, workType].filter((x) => x);
toUrl = ${segments.join("/")}?industry=${industry};
} else {
const segments = [jobFunction, industry, location, workType].filter((x) => x);
toUrl = segments.join("/");
}
if (experienceLevel) {
toUrl += ${toUrl.indexOf("?") === -1 ? "?" : "&"}experience=${experienceLevel};
}
if (term.trim()) {
toUrl += ${toUrl.indexOf("?") === -1 ? "?" : "&"}q=${encodeURI(term.replace(" ", "+"))};
}
if (sortBy.trim()) {
toUrl += ${toUrl.indexOf("?") === -1 ? "?" : "&"}sort=${sortBy};
}
if (authenticated === "true") {
toUrl += ${toUrl.indexOf("?") === -1 ? "?" : "&"}authenticated=${Date.now()};
}
const wholeUrl = ${form.getAttribute("action")}/${toUrl.toLocaleLowerCase()};
window.location.assign(wholeUrl.replace(//$/, ""));
return false;
},
}; Homepage Rest of Uganda Expression of Interest for Partnership on Emergency Preparedness, Humanitarian Assistance, and Development Programming in Uganda’s Refugee Response R Expression of Interest for Partnership on Emergency Preparedness, Humanitarian Assistance, and Development Programming in Uganda’s Refugee Response Reliefweb Today New Rest of Uganda Confidential Share link Share on
[Click the Apply button below to see the contact details]