I am trying to stop a form from submitting when using a barcode scanner to input text into the highlighted field. When I press the button on the scanner it automatically tries to submit using a higher precedence submit button in the form. I have tried to use an ignore function in javascript but can't find the key code value for the scanner. Is there a way to set the precedence of the different submit buttons without having to rearrange them? This is how I have the buttons set up 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>
Most scanners allow you to program what characters are sent as part of the scan. You can usually find the scanner's model manual online, download it, and then scan the correct programming codes to get the scan to send through what you want.