Lionel
21 January 2019 12:37
1
Hi,
I want to declare an input (which is part of an EditableList) as required
I have tried that
$( "<input/>", { class: "node-input-text-value-en" ,
type : "text",
style: "margin-left: 15px; width: 70%;",
required
}
)
But it doesn't work ... can you help ? Thx
Hi @Lionel - when sharing code, please use ``` around your code rather than blockquoting which doesn't do anything to maintain the code formatting.
"required" is not a flag you set on the html input element - you set it against the properties listed in the node's defaults object. https://nodered.org/docs/creating-nodes/properties
Lionel
21 January 2019 12:55
3
BUT, the concerned input element is part of an EditableList, so it is not declared in the default objects, only the EditableList is declared in defaults
In which case you'll have to build in your own logic to check if the field has a valid value or not. There's no built-in way of doing that.
Lionel
21 January 2019 13:51
5
I have added a "border" property in the input style, in case of bad entry
style: "margin-left: 15px; width: 70%; border: solid 1px #FF0000;"
And it seems, it is not supported, there is no effect.
Can you tell me where I can find the supported HTML options for the input ?