{"action":"opened","issue":{"url":"https://api.github.com/repos/openwrt/luci/issues/313","labels_url":"https://api.github.com/repos/openwrt/luci/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/openwrt/luci/issues/313/comments","events_url":"https://api.github.com/repos/openwrt/luci/issues/313/events","html_url":"https://github.com/openwrt/luci/issues/313","id":56272191,"number":313,"title":"match patterns in cbi :depends()","user":{"login":"poranje","id":622985,"avatar_url":"https://avatars.githubusercontent.com/u/622985?v=3","gravatar_id":"","url":"https://api.github.com/users/poranje","html_url":"https://github.com/poranje","followers_url":"https://api.github.com/users/poranje/followers","following_url":"https://api.github.com/users/poranje/following{/other_user}","gists_url":"https://api.github.com/users/poranje/gists{/gist_id}","starred_url":"https://api.github.com/users/poranje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poranje/subscriptions","organizations_url":"https://api.github.com/users/poranje/orgs","repos_url":"https://api.github.com/users/poranje/repos","events_url":"https://api.github.com/users/poranje/events{/privacy}","received_events_url":"https://api.github.com/users/poranje/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-02T18:12:59Z","updated_at":"2015-02-02T18:12:59Z","closed_at":null,"body":"CBI provides the :depends() method on option objects that allow to dynamically show or hide the object field depending on the value in some other field.\r\n\r\nthe method is called as obj:depends( some_other_option, value ) - or with a table of likewise tuples).\r\nWhen value could be specified as a regular expression pattern, then the dependency condition can cover many values, which is impossible now.\r\n\r\nExamples:\r\no:depends(\"name\", \".+ Oranje\")\r\nwhich would allow the form to include/exclude fields when it of my kinsmen of which there are many\r\nor\r\no.depends(\"phonenumber\", \"(00|+)[%d]+\")\r\nwhich would show option o when the phone number concerns an international number.\r\n"}}