$input_error = 1;
display_error( _("The account name cannot be empty."));
set_focus('account_name');
- }
- elseif (!$accounts_alpha && !is_numeric($_POST['account_code']))
+ }
+ elseif (!$accounts_alpha && !preg_match("/^[0-9.]+$/",$_POST['account_code'])) // we only allow 0-9 and a dot
{
$input_error = 1;
display_error( _("The account code must be numeric."));
set_focus('account_code');
}
-
if ($input_error != 1)
{
if ($accounts_alpha == 2)
display_notification(_("New account has been added."));
$selected_account = $_POST['AccountList'] = $_POST['account_code'];
}
+ else
+ display_error(_("Account not added, possible duplicate Account Code."));
}
$Ajax->activate('_page_body');
}