Skip to content

Commit

Permalink
problem:Amount textbox don't have maximum character limit
Browse files Browse the repository at this point in the history
solution : set maximum character length.
  • Loading branch information
rkbsoftsolutions committed Oct 17, 2018
1 parent 63c4cfc commit ee6f6a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions imports/ui/pages/auctions/currencyAuction.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Template.currencyAuction.onCreated(function() {
Meteor.setInterval(() => this.now.set(Date.now()), 250) // update the timer every 250ms for smooth drainage
})



Template.currencyAuction.onRendered(function(){
const instance=Template.instance();
Meteor.setTimeout(()=>{
instance.$("#js-amount").on("input",function(){
this.value=this.value.slice(0,this.maxLength);
});
},10)
})

Template.currencyAuction.helpers({
currencies: () => {
let bids = Bids.find({
Expand Down
3 changes: 2 additions & 1 deletion imports/ui/pages/auctions/currencyAuction.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ <h5 class="card-title">{{_ "auctions.currency.crypto"}}</h5>
<hr>
<h5 class="card-title">{{_ "auctions.currency.amount"}}</h5>
<div class="input-group">
<input type="number" step="any" min="0" id="js-amount" name="amount" placeholder="0" class="form-control">
<input type="number" step="any" min="0" id="js-amount"
name="amount" placeholder="0" maxlength="10" class="form-control">
<span style="padding: 20px;"><b style="color: green">{{fixed balance}}</b> KZR</span>
</div>
<div id="amountError" class="invalid-feedback"></div>
Expand Down

0 comments on commit ee6f6a6

Please sign in to comment.