aboutsummaryrefslogtreecommitdiffstats
path: root/public/js/setup.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2014-08-05 23:09:17 -0700
committerAdam Soltys <[email protected]>2014-08-05 23:09:17 -0700
commit5c81f355aeba4df5ea840540f302c2e55e1deddd (patch)
tree64fb003b99e3e4b790c1b4d47fd50962c630b08a /public/js/setup.js
parent7ed32d3ab9992797c5caed93d7394479a7810105 (diff)
downloadcoinos-server-5c81f355aeba4df5ea840540f302c2e55e1deddd.tar.gz
coinos-server-5c81f355aeba4df5ea840540f302c2e55e1deddd.zip
Validate user edit form
Diffstat (limited to 'public/js/setup.js')
-rw-r--r--public/js/setup.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/public/js/setup.js b/public/js/setup.js
index 357b908e..9552e715 100644
--- a/public/js/setup.js
+++ b/public/js/setup.js
@@ -35,11 +35,18 @@
return $("#symbol option[value='bitstamp']").attr('selected', 'selected');
}
}).change();
- $('#address').change(function() {
+ $('#title').blur(function() {
+ if ($(this).val() === '') {
+ return $(this).parent().addClass('has-error');
+ } else {
+ return $(this).parent().removeClass('has-error');
+ }
+ });
+ $('#address').blur(function() {
if (check_address($(this).val())) {
- return $(this).css('color', 'black');
+ return $(this).parent().removeClass('has-error');
} else {
- return $(this).css('color', 'red');
+ return $(this).parent().addClass('has-error');
}
});
$('#confirm').blur(function() {
@@ -52,7 +59,9 @@
}
});
$('#setup').submit(function() {
- if ($('.has-error').length()) {
+ $('.form-control').blur();
+ if ($('.has-error').length > 0) {
+ $('.has-error').effect('shake', 500);
return false;
}
});