0

How to disable the auto-percentage calculation happen in doublebox?

asked 2009-11-02 05:15:26 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

updated 2009-11-02 05:20:49 +0800

If we enter 5% in a doublebox, it is automatically converted into 0.05 on onOK event.

Test code:

<window title="doublebox demo" border="normal">
		<doublebox></doublebox>
		<doublebox></doublebox>
	</window>

But, I don't want this to happen and I want to do some calculations based on this % symbol.

Can we able to disable this auto-percentage calculation in doublebox? Or any other suggestion regarding the same?

Thanks.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-11-02 18:03:00 +0800

jj gravatar image jj
638 3

How about a text box with your own regex rule: [\d.]+\%?

link publish delete flag offensive edit

answered 2009-11-03 00:28:05 +0800

baskaraninfo gravatar image baskaraninfo
536 2 2 9

Thank you, jj :)

Yes, your suggestion works, but regex gets validated when the focus leaves the field.

I have set the constraint as follows:
<textbox constraint="/.[0-9|%]+/" />
Then it allows "654%43" as valid value. How can we set % as the last character and only once?

Is there any way to apply filter while typing using regex?

Thanks.

link publish delete flag offensive edit
Your reply
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

Follow

RSS

Stats

Asked: 2009-11-02 05:15:26 +0800

Seen: 280 times

Last updated: Nov 03 '09

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