diff options
Diffstat (limited to 'StoneIsland/www/js/lib/view/Serializable.js')
| -rwxr-xr-x | StoneIsland/www/js/lib/view/Serializable.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/StoneIsland/www/js/lib/view/Serializable.js b/StoneIsland/www/js/lib/view/Serializable.js index fa4eba02..ae0a4fbc 100755 --- a/StoneIsland/www/js/lib/view/Serializable.js +++ b/StoneIsland/www/js/lib/view/Serializable.js @@ -42,7 +42,7 @@ var SerializableView = View.extend({ this.$("input[name], select[name], textarea[name]").each( function(){ if (this.type == "checkbox") { if ($(this).prop("checked")) { - fields[this.name] = this.value + fields[this.name] = this.value || "true" } } else { @@ -77,6 +77,9 @@ var SerializableView = View.extend({ update_date: function(e){ var $target = $(e.currentTarget), value = $target.val() var label = moment(value).format("MM/DD/YYYY") + if (label === 'Invalid date') { + label = 'BIRTHDAY (OPTIONAL)' + } $target.parent().addClass("picked") $target.parent().find("span").html(label) }, @@ -128,7 +131,7 @@ var SerializableView = View.extend({ } else { this.hide_errors() - cordova.plugins.Keyboard.close() + window.cordova && cordova.plugins.Keyboard.close() } var finalized_data = this.finalize(valid.data) |
