{"action":"closed","issue":{"url":"https://api.github.com/repos/kobotoolbox/enketo-express/issues/558","repository_url":"https://api.github.com/repos/kobotoolbox/enketo-express","labels_url":"https://api.github.com/repos/kobotoolbox/enketo-express/issues/558/labels{/name}","comments_url":"https://api.github.com/repos/kobotoolbox/enketo-express/issues/558/comments","events_url":"https://api.github.com/repos/kobotoolbox/enketo-express/issues/558/events","html_url":"https://github.com/kobotoolbox/enketo-express/issues/558","id":179720612,"number":558,"title":"How do you set input value programmatically?","user":{"login":"barrowsglobal","id":22342430,"avatar_url":"https://avatars.githubusercontent.com/u/22342430?v=3","gravatar_id":"","url":"https://api.github.com/users/barrowsglobal","html_url":"https://github.com/barrowsglobal","followers_url":"https://api.github.com/users/barrowsglobal/followers","following_url":"https://api.github.com/users/barrowsglobal/following{/other_user}","gists_url":"https://api.github.com/users/barrowsglobal/gists{/gist_id}","starred_url":"https://api.github.com/users/barrowsglobal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barrowsglobal/subscriptions","organizations_url":"https://api.github.com/users/barrowsglobal/orgs","repos_url":"https://api.github.com/users/barrowsglobal/repos","events_url":"https://api.github.com/users/barrowsglobal/events{/privacy}","received_events_url":"https://api.github.com/users/barrowsglobal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-28T09:17:15Z","updated_at":"2016-09-28T15:57:37Z","closed_at":"2016-09-28T15:57:37Z","body":"I am using a third party barcode scanner to return the barcode, and then set this barcode in the input field. I have successfully done this, but the value is not recognised as being set.\r\n\r\nThis is sample code, I've replaced the barcode scanning with setting a test value on click:\r\n```\r\n$('input[data-type-xml=\"barcode\"]').bind('click', function(){\r\n                $(this).val('test').trigger('change');\r\n});\r\n```\r\n\r\nIf I submit my form, the value does not get submitted, even though I can physically see it before submission. If I have it as a required field, it tells me that the field is required (see below screenshot)\r\n![barcode](https://cloud.githubusercontent.com/assets/22342430/18907501/248e5546-856c-11e6-9d07-293c058e6758.png)\r\n\r\nHow do I get it to recognise this value as being set for submission or validation?\r\n\r\n\r\n"}}
{"actor":{"display_login":"MartijnR"}}