Hello,
Im trying to get a custom menu ready to send customized notifications via input fields.
Sadly im not into JS.
Can someone tell me how to get the value of an input field i added?
my custom_menu.json:
{
"id": "custom",
"type": "menu",
"icon": "id-card-o",
"text": "%%TRANSLATE:CUSTOM_MENU%%",
"items": [{
"id": "custom-item-1",
"type": "item",
"icon": "dot-circle-o",
"text": "Next page",
"action": "NOTIFICATION",
"content": {
"notification": "INCREMENT_PAGE",
"payload": null
}
},
{
"id": "custom-item-2",
"type": "item",
"icon": "dot-circle-o",
"text": "Last page",
"action": "NOTIFICATION",
"content": {
"notification": "DECREMENT_PAGE",
"payload": null
}
},
{
"id": "level2",
"type": "menu",
"menu": "custom",
"icon": "bars",
"text": "Send notifications",
"items": [
{
"id": "custom-item-3",
"type": "input",
"icon": "dot-circle-o",
"text": "Notification",
"action": null,
"content": null
},
{
"id": "custom-item-4",
"type": "input",
"icon": "dot-circle-o",
"text": "Payload",
"action": null,
"content": null
},
{
"id": "custom-item-5",
"type": "button",
"icon": "dot-circle-o",
"text": "Send",
"action": "NOTIFICATION",
"content": {
"notification": null,
"payload": null
}
}
]
}
]
}
The button (last entry) should now send an notification with the values from the input fields above.
something like this:
{
"id": "custom-item-5",
"type": "button",
"icon": "dot-circle-o",
"text": "Send",
"action": "NOTIFICATION",
"content": {
"notification": "custom-item-3".value,
"payload": "custom-item-4".value
}
}
So how can i get the value from my input items?
Thanks :)
And another question. Is there a security problem when im neither using an ApiKey nor the secureEndpoints? Im using it in my private secured wifi with only me inside.