0

Datebox Input control constraint for no imput letters

asked 2011-02-16 05:19:40 +0800

joredva gravatar image joredva
69

Greetings
I have an datebox input object and the user can enter letters and numbers
How I can prevent the user from entering letters on this subject?
what is the appropriate constraint to use

Thanks
JEVM

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-02-19 03:36:06 +0800

joredva gravatar image joredva
69

Hi Todd

I use ZK 3.6.4

Jorge

link publish delete flag offensive edit

answered 2011-02-18 10:21:27 +0800

twiegand gravatar image twiegand
1807 3

joredva,

Which version of ZK are you running? In ZK 5.0.5, this code works fine:

<zk>
	<datebox id="dtbFFin"/>
	<zscript>
		dtbFFin.setFormat("yyyy-MM-dd");
	</zscript>
</zk>

If that doesn't work for you, try using a custom constraint. You'll have more control that way.

Todd

link publish delete flag offensive edit

answered 2011-02-18 02:20:44 +0800

joredva gravatar image joredva
69

twiegand

I set format with this Java code

protected Datebox dtbFFin;
...
...
dtbFFin.setFormat("yyyy-MM-dd")


but dont work

link publish delete flag offensive edit

answered 2011-02-16 11:47:40 +0800

twiegand gravatar image twiegand
1807 3

joredva,

The datebox is supposed to accept letters and numbers based on the date format you allow them to enter. So while I'm not sure you can actually stop them from keying in numbers and letters (without writing some javascript) you CAN throw an error message if they don't enter the format you want. For example, if you wanted the user to only enter in a format of mm/dd/yyyy (no letters), then simply configure your <datebox> like this:

<datebox format="MM/dd/yyyy"/>

Hope that helps,

Todd

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: 2011-02-16 05:19:40 +0800

Seen: 432 times

Last updated: Feb 19 '11

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