Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
HowTo: Constrain Datum Inputs
wscott
The sort of values that a page editor can enter into component datums can be constrained somewhat by the component author. In other words, when you are making a component, you can place additional validation on some of your datums. Right now this is only available on a few types of datums.
Number Datum: Min and Max
If you put a "Min" attribute on a number datum, any number input into that datum that is below the Min will not validate. Similarly, if you put a "Max" attribute, any number above that Max will not validate. For example:
[html]
42
[/html]When a user tries to input a number via the Edit Component window on the page edit screen, they can only enter numbers between 12 and 72. Min and Max can be entered as decimals (floats). You don't need to have both; for example, if you only have a Min, then the the input number's maximum is unconstrained (although the input gets parsed into a float, so for practical purposes it is constrained by Float.MAX_VALUE).
String Datum: Min and Max
On a string datum, Min and Max attributes refer to the length of the string. For example:
[html]
text string
[/html]Only strings of at least 2 characters and at most 14 characters will be accepted as input. As with the number datum, you don't need to have both (one or the other will work).
Find more posts tagged with
Comments
There are no comments yet