summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-04-21 20:36:17 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-04-22 00:44:53 +0200
commita34631f84ecdcc856741428d9f3e137616a4c444 (patch)
treecc91ed52f8d62fcee76990b30fe828f552365b14 /apps/contacts
parent69f3b5e2d26d065351d61bfd8119181ebde08942 (diff)
downloadnextcloud-server-a34631f84ecdcc856741428d9f3e137616a4c444.tar.gz
nextcloud-server-a34631f84ecdcc856741428d9f3e137616a4c444.zip
Contacts: Add check for empty FN field.
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/js/contacts.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 5f2bd6e9df9..e5b34e241cb 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1403,6 +1403,14 @@ $(document).ready(function(){
Contacts.UI.Card.saveProperty(this);
});
+ $('#fn').blur(function(){
+ if($('#fn').val() == '') {
+ OC.dialogs.alert(t('contacts','The name field cannot be empty. Please enter a name for this contact.'), t('contacts','Name is empty'), function() { $('#fn').focus(); });
+ $('#fn').focus();
+ return false;
+ }
+ });
+
// Name has changed. Update it and reorder.
$('#fn').live('change',function(){
var name = $('#fn').val();