on 02-08-2008 11:39 AM
Dear Experts
I want to allow the user to enter only the digits.(Actually this inputfield is for "Year")
Please give me the sugeestions.
Urgent
Thanks
Hazrath.G
You can't force that in the browser, you can only check it on the server.
Armn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hazrath,
Check ASCII values for the keyboard key except numerics.
Regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hazrath,
If you bind the attribute type of integer, the framework will do the rest (i.e. automatic validation). In validation you need to check the value is valid or not like
if(wdContext.currentContextElement().get<name>()>1999)
regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hazrath,
Say your attribute name is year of type integer.
You can convert it as String set it to your model attribute like this:
wdContext.current<modelnode>().set<attribute>(String.valueOf(wdContext.currentContextElement().getYear()));
More Info:
If you want set Min. and Max. values for this input, create a simple type attribute as other forum members specified (Say YEAR).
Properties:
Built-In Type - integer
Value Constraints:
Minimum Inclusive -- MINIMUM YEARS ALLOWED ( e.g.1988)
Maximum Inclusive -- MAXIMUM YEARS ALLOWED ( e.g.1988)
Now set the attribute type to this YEAR. Now all the validations are taken care by framework.
regards,
Siva
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.