Optional default value for input_num()
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 6 Jul 2008 21:17:16 +0000 (21:17 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 6 Jul 2008 21:17:16 +0000 (21:17 +0000)
includes/ui/ui_input.inc

index 74437698b62b80c087a04067326027e07156d203..b775ede018e5b8ae68d83ae3f734f3e812043bc3 100644 (file)
@@ -67,10 +67,10 @@ function simple_page_mode($numeric_id = true)
 //
 //     Read numeric value from user formatted input
 //
-function input_num($postname=null)
+function input_num($postname=null, $dflt=null)
 {
        if (!isset($_POST[$postname]))
-               return null;
+               return $dflt;
 
     return user_numeric($_POST[$postname]);
 }