From a34631f84ecdcc856741428d9f3e137616a4c444 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sat, 21 Apr 2012 20:36:17 +0200 Subject: [PATCH] Contacts: Add check for empty FN field. --- apps/contacts/js/contacts.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 5f2bd6e9df..e5b34e241c 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();