I am trying to stop form submission when using a barcode scanner to enter text in a selected field. When I click on the button on the scanner, it automatically tries to submit using the submit button of a higher priority on the form. I tried to use the ignore function in javascript, but cannot find the key code value for the scanner. Is there a way to set priority for different submit buttons without having to reorder them? This is how I have the buttons installed in the code:
<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>
source
share