diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-04-21 20:36:17 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-04-22 00:44:53 +0200 |
commit | a34631f84ecdcc856741428d9f3e137616a4c444 (patch) | |
tree | cc91ed52f8d62fcee76990b30fe828f552365b14 /apps/contacts | |
parent | 69f3b5e2d26d065351d61bfd8119181ebde08942 (diff) | |
download | nextcloud-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.js | 8 |
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(); |