Hi,
I have create a config node for another node and it has credential input fields. How can I make those fields required? With normal input fields, I would set required: true in defaults of RED.nodes.registerType, but what about credential input fields. Docs mention, that the only property is type, which can be "text" or "password", but it seems there is no required-property. Any hints?
Same as default, type
has a different meaning between the credentials
and defaults
properties.
RED.nodes.registerType("your-type", {
credentials: {
yourCred: { type: "text", required: true },
},
defaults: {
name: { value: "" },
config: { type: "mqtt-broker" },
},
}
2 Likes
Thank you! So it's the same like non-credential input fields?
When I read the docs - Node credentials : Node-RED - and it says "The entries take a single option - their type
which can be either text
or password
" I thought only "type" property is possible.
Yeah, the documentation is unfortunately not up to date.
1 Like