Avoid submitting the precat copy checkout entry form when the Enter key
is pressed on the ISBN field. Do this to allow scanners to enter ISBN
data without automatically submitting the form.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
<div class="form-group">
<label for="precat-isbn">[% l('ISBN') %]</label>
<input type="text" class="form-control" id="precat-isbn"
+ ng-keydown="preventSubmit($event)"
ng-model="precatArgs.dummy_isbn" placeholder="[% l('ISBN...') %]"/>
</div>
<div class="form-group">
$scope.circModifiers = circMods;
$scope.ok = function(args) { $uibModalInstance.close(args) }
$scope.cancel = function () { $uibModalInstance.dismiss() }
+
+ // use this function as a keydown handler on form
+ // elements that should not submit the form on enter.
+ $scope.preventSubmit = function($event) {
+ if ($event.keyCode == 13)
+ $event.preventDefault();
+ }
}],
resolve : {
circMods : function() {