My if blocks are getting too long. I'm looking for a way to use shorthand. Any suggestions?
if (selected.value == "" || search.value == "") {
data;
} else if (selected.value == "Email") {
data["email"] = search.value;
} else if (selected.value == "Name") {
data["name"] = search.value;
} else if (selected.value == "Surname") {
data["surname"] = search.value;
}