From: Thomas Tanghus Date: Sat, 21 Apr 2012 18:36:17 +0000 (+0200) Subject: Contacts: Add check for empty FN field. X-Git-Tag: v4.0.0beta~237 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a34631f84ecdcc856741428d9f3e137616a4c444;p=nextcloud-server.git Contacts: Add check for empty FN field. --- 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();