aboutsummaryrefslogtreecommitdiffstats
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/views/details.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/www/js/views/details.js b/www/js/views/details.js
index b5e94e5..6b4544a 100644
--- a/www/js/views/details.js
+++ b/www/js/views/details.js
@@ -73,6 +73,22 @@
}
},
+ validationError: function(id, error) {
+ var el_id = '#' + id;
+ var el = $(el_id);
+
+ el.addClass('error');
+ if ( el.val() === '' ) {
+ el.attr('orig-placeholder', el.attr('placeholder'));
+ el.attr('placeholder', error);
+ }
+ },
+
+ clearValidationErrors: function() {
+ $('.error').removeClass('error');
+ $('.error').each(function(el) { if ( el.attr('orig-placeholder') ) { el.attr('placeholder', el.attr('orig-placeholder') ); } } );
+ },
+
setSelectClass: function() {
var cat = this.$('#form_category');
if ( cat.val() !== "" && cat.val() !== '-- Pick a category --' ) {