amount validation
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
<div>
|
||||
<div><select ng-model='account' ng-change='refreshList()' ng-options="account.name for account in accounts track by account.id"></select></div>
|
||||
<div>
|
||||
<form role="form" ng-submit="postTransaction()">
|
||||
<form name="form" ng-submit="postTransaction()">
|
||||
<div>
|
||||
Betrag: <input ng-model='transaction.amount' type='number' step='0.01' />
|
||||
Betrag: <input name="amount" ng-model='transaction.amount' type='text' required ng-pattern="/^[+-]?(?:\d+(?:[\.,]\d{0,2})?|[\.,]\d{1,2})$/" />
|
||||
</div>
|
||||
<span ng-show="form.amount.$error.pattern"">The value is not a valid value!</span>
|
||||
<div>
|
||||
Kategorie: <select ng-model='transaction.category' size='1'
|
||||
ng-options="category.name for category in categories track by category._links.self.href">
|
||||
@@ -18,7 +19,7 @@
|
||||
Notiz: <input ng-model='transaction.description' type='text' size='20' />
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" />
|
||||
<input type="submit" ng-disabled="form.amount.$error.pattern" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user