-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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
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
Asked: 2011-02-16 05:19:40 +0800
Seen: 434 times
Last updated: Feb 19 '11