{"action":"created","issue":{"url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/90","labels_url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/90/comments","events_url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/90/events","html_url":"https://github.com/alphagov/govuk_admin_template/pull/90","id":111855268,"number":90,"title":"Add checkbox and radio form toggles","user":{"login":"fofr","id":319055,"avatar_url":"https://avatars.githubusercontent.com/u/319055?v=3","gravatar_id":"","url":"https://api.github.com/users/fofr","html_url":"https://github.com/fofr","followers_url":"https://api.github.com/users/fofr/followers","following_url":"https://api.github.com/users/fofr/following{/other_user}","gists_url":"https://api.github.com/users/fofr/gists{/gist_id}","starred_url":"https://api.github.com/users/fofr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fofr/subscriptions","organizations_url":"https://api.github.com/users/fofr/orgs","repos_url":"https://api.github.com/users/fofr/repos","events_url":"https://api.github.com/users/fofr/events{/privacy}","received_events_url":"https://api.github.com/users/fofr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-16T15:32:06Z","updated_at":"2015-10-16T16:05:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alphagov/govuk_admin_template/pulls/90","html_url":"https://github.com/alphagov/govuk_admin_template/pull/90","diff_url":"https://github.com/alphagov/govuk_admin_template/pull/90.diff","patch_url":"https://github.com/alphagov/govuk_admin_template/pull/90.patch"},"body":"Create a checkbox toggle and a radio toggle so that content can be conditionally revealed and forms simplified.\r\n\r\nThe JS is derived from GOV.UK elements patterns, setting aria controls and aria hidden attributes dynamically. A checkbox and a toggle target are linked together with an ID. http://govuk-elements.herokuapp.com/form-elements/#form-toggle-content\r\n\r\nThe modules check the current state of the form and then hide or show content accordingly. All content is displayed when JS is disabled.\r\n\r\nThis is a pattern many apps are already using, but the JS is usually bespoke and inaccessible. \r\n\r\nFor an example of usage, see https://github.com/alphagov/whitehall/compare/toggle-form-fields\r\n\r\n![radio-checkbox-toggling](https://cloud.githubusercontent.com/assets/319055/10545865/c278f1fa-7422-11e5-88f2-3420cc20179c.gif)\r\n\r\ncc @gemmaleigh @alextea "},"comment":{"url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/comments/148756114","html_url":"https://github.com/alphagov/govuk_admin_template/pull/90#issuecomment-148756114","issue_url":"https://api.github.com/repos/alphagov/govuk_admin_template/issues/90","id":148756114,"user":{"login":"alextea","id":523014,"avatar_url":"https://avatars.githubusercontent.com/u/523014?v=3","gravatar_id":"","url":"https://api.github.com/users/alextea","html_url":"https://github.com/alextea","followers_url":"https://api.github.com/users/alextea/followers","following_url":"https://api.github.com/users/alextea/following{/other_user}","gists_url":"https://api.github.com/users/alextea/gists{/gist_id}","starred_url":"https://api.github.com/users/alextea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextea/subscriptions","organizations_url":"https://api.github.com/users/alextea/orgs","repos_url":"https://api.github.com/users/alextea/repos","events_url":"https://api.github.com/users/alextea/events{/privacy}","received_events_url":"https://api.github.com/users/alextea/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T16:05:51Z","updated_at":"2015-10-16T16:05:51Z","body":"This looks good. How can I preview it?"}}