Gazelle/static/functions/form_validate.js
2013-07-28 08:00:53 +00:00

39 lines
798 B
JavaScript

$(document).ready(function() {
var url = new URL();
var query = url.query;
switch (url.path) {
case "forums":
if (query['action'] == "new") {
$("#newthreadform").validate();
}
break;
case "reports":
if (query['action'] == "report") {
$("#report_form").validate();
}
break;
case "inbox":
if (query['action'] == "viewconv" || query['action'] == "compose") {
$("#messageform").validate();
}
break;
case "user":
if (query['action'] == "notify") {
$("#filter_form").validate();
}
break;
case "requests":
if (query['action'] == "new") {
$("#request_form").preventDoubleSubmission();
}
break;
case "sitehistory":
if (query['action'] == "edit") {
$("#event_form").validate();
}
break;
default:
break;
}
});