X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_input.inc;h=6c09d0979f83f6fcf806ed45628396a49152249a;hb=5af53b13622ca77bc851cccaa087d7e2aedc3401;hp=0831e6103df0fd66369deac64cc2bbc30bfc66d1;hpb=de3a75773afa86df1739d14f24399d6f7a46f809;p=fa-stable.git diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 0831e610..6c09d097 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -1,5 +1,25 @@ $postval ) { + if (strpos($postkey, $prefix) === 0) { + $id = substr($postkey, strlen($prefix)); + return $numeric ? (int)$id : $id; + } + } + return $numeric ? -1 : null; +} + +//------------------------------------------------------------------------------ +// +// Read numeric value from user formatted input +// function input_num($postname=null) { if (!isset($_POST[$postname])) return null; @@ -18,6 +38,7 @@ function hidden($name, $value) function submit($name, $value, $echo=true) { + default_focus($name); $submit_str = "\n"; if ($echo) echo $submit_str; @@ -98,7 +119,8 @@ function submit_row($name, $value, $right=true, $extra="") function button($name, $value, $onclick) { - echo "\n"; + default_focus($name); + echo "\n"; } function button_cell($name, $value, $onclick) @@ -119,6 +141,7 @@ function check_value($name) function check($label, $name, $value, $submit_on_change=false) { + default_focus($name); if ($label) echo $label . " "; @@ -205,6 +228,7 @@ function label_row($label, $value, $params="", $params2="", $leftfill=0) function text_cells($label, $name, $value, $size="", $max="", $params="", $post_label="", $disabled="") { + default_focus($name); if ($label != null) label_cell($label, $params); echo ""; @@ -221,6 +245,7 @@ function text_cells($label, $name, $value, $size="", $max="", $params="", $post_ function text_cells_ex($label, $name, $size, $max=null, $init=null, $params=null, $post_label=null) { + default_focus($name); if (!isset($_POST[$name]) || $_POST[$name] == "") { if ($init) @@ -291,7 +316,7 @@ function date_cells($label, $name, $init=null, $inc_days=0, $inc_months=0, $inc_ $_POST[$name] = $init; } if ($use_date_picker) - $post_label = "" + $post_label = "" . " "._(\n"; else $post_label = ""; @@ -433,6 +458,7 @@ function small_qty_cells($label, $name, $init=null, $params=null, $post_label=nu function textarea_cells($label, $name, $value, $cols, $rows, $params="") { + default_focus($name); if ($label != null) echo "$label\n"; if ($value == null) @@ -451,6 +477,7 @@ function textarea_row($label, $name, $value, $cols, $rows, $params="") function text_row_with_submit($label, $name, $value, $size, $max, $input_name, $input_value) { + default_focus($name); echo "$label\n"; echo "";