{"action":"created","issue":{"url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/398","labels_url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/398/comments","events_url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/398/events","html_url":"https://github.com/defunkt/jquery-pjax/issues/398","id":35043146,"number":398,"title":"form submit: filter values on submit event","user":{"login":"staabm","id":120441,"avatar_url":"https://avatars.githubusercontent.com/u/120441?v=3","gravatar_id":"","url":"https://api.github.com/users/staabm","html_url":"https://github.com/staabm","followers_url":"https://api.github.com/users/staabm/followers","following_url":"https://api.github.com/users/staabm/following{/other_user}","gists_url":"https://api.github.com/users/staabm/gists{/gist_id}","starred_url":"https://api.github.com/users/staabm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/staabm/subscriptions","organizations_url":"https://api.github.com/users/staabm/orgs","repos_url":"https://api.github.com/users/staabm/repos","events_url":"https://api.github.com/users/staabm/events{/privacy}","received_events_url":"https://api.github.com/users/staabm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-06-05T10:01:52Z","updated_at":"2015-02-07T09:20:01Z","closed_at":null,"body":"I would like to filter some values before pjax submits them. ATM the only way to achieve that is to remove the related input-fields from the DOM, which is rather expensive.\r\n\r\n```\r\n$(document).on('submit', 'form', function(event) {\r\n var container = $(this).closest('[data-pjax-container]')\r\n\r\n // XXX filter values here\r\n $(this).find(\":input\").filter(function () {\r\n   return $.trim(this.value).length == 0\r\n }).remove();\r\n\r\n $.pjax.submit(event, container)\r\n})\r\n```\r\n\r\nIs there a \"better way\" to achieve that?"},"comment":{"url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/comments/73356893","html_url":"https://github.com/defunkt/jquery-pjax/issues/398#issuecomment-73356893","issue_url":"https://api.github.com/repos/defunkt/jquery-pjax/issues/398","id":73356893,"user":{"login":"mislav","id":887,"avatar_url":"https://avatars.githubusercontent.com/u/887?v=3","gravatar_id":"","url":"https://api.github.com/users/mislav","html_url":"https://github.com/mislav","followers_url":"https://api.github.com/users/mislav/followers","following_url":"https://api.github.com/users/mislav/following{/other_user}","gists_url":"https://api.github.com/users/mislav/gists{/gist_id}","starred_url":"https://api.github.com/users/mislav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mislav/subscriptions","organizations_url":"https://api.github.com/users/mislav/orgs","repos_url":"https://api.github.com/users/mislav/repos","events_url":"https://api.github.com/users/mislav/events{/privacy}","received_events_url":"https://api.github.com/users/mislav/received_events","type":"User","site_admin":true},"created_at":"2015-02-07T09:20:01Z","updated_at":"2015-02-07T09:20:01Z","body":"Sure, if something is broken then please do fix it. I'd like to know why it doesn't work."}}