This commit is contained in:
Albert Yi
2018-04-12 13:00:17 -07:00
parent cd88a8df9f
commit 883b36ac2e

View File

@@ -32,16 +32,16 @@
if (($("#upload_file").val() === "") && ($("#upload_source").val() === "")) {
error_messages.push("Must choose file or specify source");
}
if (!$("#upload_rating_s")[0].checked && !$("#upload_rating_q")[0].checked && !$("#upload_rating_e")[0].checked &&
if (!$("#upload_rating_s").prop("checked") && !$("#upload_rating_q").prop("checked") && !$("#upload_rating_e").prop("checked") &&
($("#upload_tag_string").val().search(/\brating:[sqe]/i) < 0)) {
error_messages.push("Must specify a rating");
}
if (error_messages.length === 0) {
$("#submit-button")[0].setAttribute("disabled","true");
$("#submit-button")[0].setAttribute("value","Submitting...");
$("#submit-button").prop("disabled","true");
$("#submit-button").prop("value","Submitting...");
$("#client-errors").hide();
} else {
$("#client-errors")[0].innerHTML = "<strong>Error</strong>: " + error_messages.join(", ");
$("#client-errors").html("<strong>Error</strong>: " + error_messages.join(", "));
$("#client-errors").show();
e.preventDefault();
}