01-19-2013 05:40 AM
How would you go about doing form validation, as i cant find any article on this?
For example validating numbers only.
hintText: "Only Numbers Allowed"
//...Perform action on submission...
01-20-2013 05:14 AM
Why don't you use the inputMode for number validation?
This should show a numbers only keyboard and will probably only allow numbers on hardware-keyboard-devices.
01-20-2013 07:38 AM
Setting inputMode won't help as the text still can be pasted.
For validation I usually create a custom control with TextField (or other components) and invisible label for validation text.
When the form is submitted, validate the values then update labels with validation text where appropriate, setting their 'visible' property to true.
You can also subscribe to TextField's signals such as onTextChanging to validate the text and show hints during editing.
01-20-2013 10:54 AM
01-20-2013 10:58 AM
01-25-2013 06:40 PM
What about text length validations? On the Roadmap page it states Length Validations were added in C5 release in December, yet I cannot find any properties on the TextField control to control the length nor any mention of this in the documentation. Am i missing something here?
"Ability to set text length restrictions on Cascades input controls. (Delayed from Beta 4 release, re-scheduled for Gold release)"