Select with default on change
See original GitHub issueI am trying to configure a select box with specific values and a default value based on another select box value selected. My present configuration is as below but I cannot select another option then the default one. Please advise the correct way.
{ "display": "form", "settings": { "pdf": { "id": "1ec0f8ee-6685-5d98-a847-26f67b67d6f0", "src": "https://files.form.io/pdf/5692b91fd1028f01000407e3/file/1ec0f8ee-6685-5d98-a847-26f67b67d6f0" } }, "components": [ { "label": "Type", "widget": "choicesjs", "tableView": true, "data": { "values": [ { "label": "Storing", "value": "Storing" }, { "label": "Vraag", "value": "Vraag" } ] }, "selectThreshold": 0.3, "validate": { "unique": false, "multiple": false }, "key": "Type", "type": "select", "indexeddb": { "filter": {} }, "input": true }, { "label": "Priority", "widget": "choicesjs", "tableView": true, "dataSrc": "custom", "data": { "values": [ {} ], "custom": "thisValues = [];\r\nif(data.Type == \"Storing\" || data.Type == \"Schade\")thisValues = [{\"label\":\"Prioriteit 1\",\"value\":\"Urgent\"}];\r\nif(data.Type == \"Vraag\" || data.Type == \"Onderhoud\" || data.Type == \"Update\")thisValues = [{\"label\":\"Prioriteit 3\",\"value\":\"Niet urgent\"}];\r\nvalues = thisValues;" }, "searchEnabled": false, "selectThreshold": 0.3, "allowCalculateOverride": true, "validate": { "unique": false, "multiple": false }, "key": "Priority", "logic": [ { "name": "SetValue Storing", "trigger": { "type": "simple", "simple": { "show": true, "when": "Type", "eq": "Storing" } }, "actions": [ { "name": "SetValue", "type": "value", "value": "value = 'Prioriteit 2';" } ] }, { "name": "SetValue Vraag", "trigger": { "type": "simple", "simple": { "show": true, "when": "Type", "eq": "Vraag" } }, "actions": [ { "name": "SetValue", "type": "value", "value": "value = 'Niet urgent'" } ] } ], "type": "select", "indexeddb": { "filter": {} }, "input": true }, { "type": "button", "label": "Submit", "key": "submit", "disableOnInvalid": true, "input": true, "tableView": false, "validate": { "unique": false, "multiple": false } } ] }
Kind regards, Mario
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
There should be another option for “Clear Value On Refresh Options” that will clear the selected item when the options change.
Hello @KyooMario,
Would please elaborate more how you were able to change the selection of Select depending on other value during runtime?