当使用条形码扫描仪将文本输入突出显示的字段时,我试图阻止表单提交。当我按下扫描仪上的按钮时,它会自动尝试使用表单中更高优先级的提交按钮进行提交。我尝试在 javascript 中使用忽略功能,但找不到扫描仪的键码值。有没有办法设置不同提交按钮的优先级而不必重新排列它们?这就是我在代码中设置按钮的方式:
<li>
<cfinput type="submit" name="add" value="Enter Package">
<cfinput type="submit" name="search" value="Search">
<cfinput type="submit" name="reset" value="Reset">
</li>
</ul>
</td>
<td>
<center><div id="labelImageDiv">
<img id="labelImage" src="" alt="label preview"/>
</div>
<ul>
<li>
<label for="printersSelect" class="left">Printer:</label>
<select id="printersSelect" class="right"></select>
<button id="printButton">Print</button>
</li>
<li>
<div class="packHead">Package Pickup</div>
<label for="pickup" class="left">Scan Barcode:</label>
<div class="right">
<cfinput type="text" name="pickup">
</div>
</li>
<li>
<div id="pickButton">
<cfinput type="submit" name="pkgPickup" value="PickUp">
</div>
</li>
</ul>