{"id":13717367,"url":"https://github.com/james2doyle/vue-ajax-form-component","last_synced_at":"2025-05-07T07:31:12.357Z","repository":{"id":57394426,"uuid":"47520151","full_name":"james2doyle/vue-ajax-form-component","owner":"james2doyle","description":"A Vue.js component for creating simple AJAX forms.","archived":true,"fork":false,"pushed_at":"2015-12-11T16:03:01.000Z","size":6,"stargazers_count":86,"open_issues_count":1,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-04T05:35:19.080Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/james2doyle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T00:34:57.000Z","updated_at":"2023-01-28T07:46:51.000Z","dependencies_parsed_at":"2022-09-09T16:50:10.201Z","dependency_job_id":null,"html_url":"https://github.com/james2doyle/vue-ajax-form-component","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fvue-ajax-form-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fvue-ajax-form-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fvue-ajax-form-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/james2doyle%2Fvue-ajax-form-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/james2doyle","download_url":"https://codeload.github.com/james2doyle/vue-ajax-form-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252833456,"owners_count":21811186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T00:01:21.289Z","updated_at":"2025-05-07T07:31:12.007Z","avatar_url":"https://github.com/james2doyle.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# vue-ajax-form-component\n\nA [Vue.js](http://vuejs.org/) component for creating simple AJAX forms.\n\n### Install\n\nAvailable through npm as `vue-ajax-form-component`. Or include as an inline script, like in `example.html`.\n\n### Demo\n\n![](http://cl.ly/image/3Q0L2K0T3Y1i/Screen%20Recording%202015-12-06%20at%2003.57%20PM.gif)\n\nYou can load up the `example.html` file here to test the directive. Just make sure you put this folder in a server that has PHP. Or you can change the `ajax-form` action attribute to point to your API endpoint.\n\n### Usage\n\nMinimal:\n\n```html\n\u003cajax-form action=\"submit.php\"\u003e\n  \u003c!-- normal stuff that goes in a form. Ex: inputs, selects, radio/checkboxs etc. --\u003e\n\u003c/ajax-form\u003e\n```\n\nFull Example:\n\n```html\n\u003cajax-form id=\"formOne\" class=\"my-form\" name=\"myCoolForm\" action=\"submit.php\" method=\"post\" v-response-type=\"json\"\u003e\n  \u003c!-- normal stuff that goes in a form. Ex: inputs, selects, radio/checkboxs etc. --\u003e\n\u003c/ajax-form\u003e\n```\n\nYou can see a custom attribute called `v-response-type`. This allows you to set the response type for your form. Most cases you will be expecting `JSON` in return, and then sending that to some variable in your Vue data.\n\nBut, sometimes maybe you are expecting back some HTML or some raw text. In those cases, you can use `v-response-type=\"html\"` or `v-response-type=\"text\"`, respectively. Then you could maybe dump the results in your view in some area. A use case for this might be for \"session\" flashes like success or error alerts, or maybe a preview of a blog post.\n\nYou can see a `Vue` instance example in [example.html](https://github.com/james2doyle/vue-ajax-form-component/blob/master/example.html) if you want more details.\n\n### Support\n\nThis component assumes you have support for [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData) and the XHR `progress` event.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames2doyle%2Fvue-ajax-form-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjames2doyle%2Fvue-ajax-form-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjames2doyle%2Fvue-ajax-form-component/lists"}