Scott Eade wrote:
> 
> Has anyone used intake with field types other than String
> and the basic integer types?
> 
> In particular I am interested in boolean and Date fields.
> Is there a way I can map a boolean to a checkbox and
> a Date to something a bit nicer than a standard text input
> box (perhaps three selects)?
> 
> Can intake validate the date values?
> 


There is boolean type        

Example

<field name="Active" key="active" type="boolean"/>

Here is a macro that adds a hidden value that intake will use in the
event the box is unchecked.  It would be used similar to
#booleanCheckbox($intake.Attribute.mapTo($attribute).Active)

#macro ( booleanCheckbox $booleanField )
   <input type="checkbox" name="$booleanField.Key" value="true"
        #if ($booleanField.Value) checked #end />
   <input type="hidden" name="$booleanField.ValueIfAbsent"
        value="false" />
#end


Date types still need to be added.  Please help with this if you have
the need.



> Also, what are the onError and validator attributes of
> the field element for (as found in the DTD)?
> 


onError should be removed I think, I will make sure it is not used.
validator is used to override the default validator for a field type. 
For example the String type currently has the DefaultValidator as its
default which provides such things as maxLength and regexp mask rules. 
Let's say you have an EmailValidator that is more efficient than a mask
rule and would like to use that, you would specify the classname in the
validator attribute.


john mcnally

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to