Gazelle/static/functions/form_validate.js

38 lines
867 B
JavaScript
Raw Normal View History

2013-05-21 08:01:09 +00:00
(function ($) {
$(document).ready(function() {
var parts = window.location.pathname.split('/');
var page = parts[parts.length - 1].split(".")[0];
var splitted = window.location.search.substr(1).split("&");
var query = {};
for (var i = 0; i < splitted.length; i++) {
var q = splitted[i].split("=");
query[q[0]] = q[1];
};
switch(page) {
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;
2013-06-09 08:01:21 +00:00
case "user":
if(query['action'] == "notify") {
$("#filter_form").validate();
}
break;
2013-05-21 08:01:09 +00:00
default:
break;
}
});
} (jQuery));