Contacts: Add check for empty FN field.

This commit is contained in:
Thomas Tanghus 2012-04-21 20:36:17 +02:00
parent 69f3b5e2d2
commit a34631f84e

View file

@ -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();