How to avoid "Too many characters are entered. At most 9 charcter are allowed" pop up when creating custom component of decimalbox

asked 2017-12-04 17:06:19 +0800

mangaldaslima gravatar image mangaldaslima
11 2

<currencybox visible="@load(eventIncomeData.folderEventIncomeRecord.folderRSN eq null)" maxlength="9" id="${vm.concat(eventIncomeData.nameTypeAndNumber)}_Prizes_component" style="text-align:left; float:left;" format="@load(vm.decimalFormat)" value="@bind(eventIncomeData.folderEventIncomeRecord.prizes)" onchange="@command('onChangePrizes', folderEventIncomeData = eventIncomeData)" tooltiptext="${vm.getText('FolderEventIncomeDetail:LABEL_PRIZES')}" placeholder="${vm.getText('FolderEventIncomeDetail:LABEL_PRIZES')}"/>

in the decimalFormat, i have Rs###,###,###,##0.0 this value, after entering 9 char and tabbing out. it's throwring above mentioned pop up in red. color.

Can anyone suggest, why it is happening so. in my case. I have checked in zk fiddle, it's working fine with version 7.0.8, only issue persisting with the custom components.

delete flag offensive retag edit


simplified to <decimalbox maxlength="9" format="Rs###,###,###,##0.0" onChange="" />


cor3000 ( 2017-12-05 09:58:43 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-12-05 11:48:46 +0800

cor3000 gravatar image cor3000
4366 2 7
ZK Team

I added a simplified version showing the same message when the formatted number exceeds the number of characters specified by the maxlength property. This property determines the maximum number of allowed characters inside the input element (including formatting characters which would be 15 in your case).

Alternatively you could implement a custom constraint, that limits the maximum value instead of the the number of characters to be independent of the formatting.

it's working fine with version 7.0.8 Can you be more specific on that? For me version 7.0.8 (8.5.0 too) shows the same default expected behavior, I don't see a difference in 7.0.8.

Another option would be to use a mask plugin as shown in our demo about form effects.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2017-12-04 17:06:19 +0800

Seen: 10 times

Last updated: Dec 05 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More