I’m trying to get html.entityFields to render a password field. In my model, I have:
property name=“password” ormtype=“string”;
this.constraints = {
password = { required=true, type=“passwordField” }
};
But that’s not working. Advice?
I’m trying to get html.entityFields to render a password field. In my model, I have:
property name=“password” ormtype=“string”;
this.constraints = {
password = { required=true, type=“passwordField” }
};
But that’s not working. Advice?
John,
this.constraints has got nothing to with how the HTMLHelper module renders entities (at least not that i know of). this.constraints is used in the cbvalidation module, which is used for server side data validation. See https://github.com/coldbox-modules/cbox-validation/wiki for more info on how cbvalidation is used.
That being said. html.entityFields will render out any property of type ‘string’ as a text input. The function does not support specifying a particular property as a password field. I find that the entityFields is fairly limited in this way and is also difficult to style on the client side. I only use entityFields as a development tool to quickly get forms built, but you will need to flesh them out for production.
Regards
Ryan