Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Created January 21, 2015 13:43
Show Gist options
  • Save DeskWOW/53b9c9d8deafbbc39a41 to your computer and use it in GitHub Desktop.
Save DeskWOW/53b9c9d8deafbbc39a41 to your computer and use it in GitHub Desktop.
Add labels to a case from support center contact form
$(".input-block select, .input-block input, .input-block textarea").on("change keyup", function() {
$("ticket_labels_new").val("");
var labels = [];
if ($("#div-inquiry-type select").val() == "Mobile App Support" && $("#div-platform select").val() == "Apple iPad" && $("#div-app select").val() == "Big Cat Week: Quest for Survival") {
labels.push("T- Channel");
}
if ($("#div-inquiry-type select").val() == "Mobile App Support" && ($("#div-platform select").val() == "Apple iPad" || $("#div-platform select").val() == "Apple iPhone or iPod Touch" || $("#div-platform select").val() == "Android Phone (any)" || $("#div-platform select").val() == "Android Tablet (any)") && $("#div-app select").val() == "Nat Geo TV") {
labels.push("T- Channel");
}
if ($("#div-category2 select").val() == "Request to combine two accounts" || $("#div-category2 select").val() == "Upload Photo Issues" || $("#div-category2 select").val() == "YourShot Assignments" || $("#div-category2 select").val() == "Other") {
labels.push("T- YourShot");
} else if ($("#div-inquiry-type select").val() == "National Geographic Community Account" || $("#div-inquiry-type select").val() == "Your Shot Photo Community") {
labels.push("T- Membership");
}
$("#ticket_labels_new").val(labels.join(","));
console.log($("#ticket_labels_new").val());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment