我想自定义一个用codeigniter php制作的POS软件。我是新手。指导我想做以下更改
我想在用户按F8时将光标设置在Textfield上,但问题出在F8上,它正在重定向到另一个页面,这是应用程序的默认行为。我想禁用此前一个效果,并希望将光标设置在textfield
我想打印销售收据。现在通过点击"完成销售"显示收据页面。 button.but我希望在用户在文本字段中输入金额时按此键,然后按回车键。
`
<?php
// Only show this part if there is at least one payment entered.
if(count($payments) > 0)
{
?>
<div id="finish_sale">
<?php echo form_open("sales/complete",array('id'=>'finish_sale_form')); ?>
<label id="comment_label" for="comment"><?php echo $this->lang->line('common_comments'); ?>:</label>
<?php echo form_textarea(array('name'=>'comment', 'id' => 'comment', 'value'=>$comment,'rows'=>'4','cols'=>'23'));?>
<br />
<br />
<?php
if(!empty($customer_email))
{
echo $this->lang->line('sales_email_receipt'). ': '. form_checkbox(array(
'name' => 'email_receipt',
'id' => 'email_receipt',
'value' => '1',
'checked' => (boolean)$email_receipt,
)).'<br />('.$customer_email.')<br />';
}
if ($payments_cover_total)
{
echo "<div class='small_button' id='finish_sale_button' style='float:left;margin-top:5px;'><span>".$this->lang->line('sales_complete_sale')."</span></div>";
}
echo "<div class='small_button' id='suspend_sale_button' style='float:right;margin-top:5px;'><span>".$this->lang->line('sales_suspend_sale')."</span></div>";
?>
</div>
</form>
<?php
}
?>`
// Javascript Mycode
$(document).keypress(function (e){
if(e.keyCode==119)
{
$("#amount_tendered").focus();
}
if(e.keyCode==13)
{
$("#finish_sale_button").click();
$('#finish_sale_form').submit();
$('#finish_sale_button').attr('action', '<?php echo site_url("sales/complete"); ?>');
});
}
//window.print();
});
//点击按钮时此功能正在调用
$("#finish_sale_button").click(function()
{
if (confirm('<?php echo $this->lang->line("sales_confirm_finish_sale"); ?>'))
{
$('#finish_sale_form').submit();
}
});