[英]Form with multiple submit buttons, how to set the default enter key action - barcode scanner input
I've been stuck on this issue. 我一直停留在这个问题上。 I have a simple form: 我有一个简单的表格:
<form>
<input type="text" name="barcode1">
<input type="submit" name="barcode1" value="Submit Barcode1">
<input type="text" name="barcode2">
<input type="submit" name="barcode2" value="Submit Barcode2">
</form>
I'm using a barcode scanner to enter the data into the text field. 我使用的条形码扫描仪的数据输入到文本字段中。 The scanner records a series of numbers, followed by a 'Enter' command. 扫描仪记录一系列数字,然后输入“ Enter”命令。
When I scan into the barcode1 field, it works perfectly, the form is submitted by the scanner's 'Enter' command. 当我扫描到条形码1字段时,它可以正常工作,该表单是由扫描仪的“输入”命令提交的。
When I scan into barcode2 field, it submits the form using the barcode1 submit. 当我进入扫描条形码2场,它使用条形码1提交提交表单。
Is it possible, to change the default submit button on a form with multiple submit buttons? 是否可以更改具有多个提交按钮的表单上的默认提交按钮? Perhaps I could set the default submit button when I focus on the text field for that submit button. 也许我可以设置默认的提交按钮,当我专注于文本字段为提交按钮。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.