Skip to content

no 'name' attribute? #286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sjsiegel001 opened this issue Sep 10, 2017 · 5 comments
Closed

no 'name' attribute? #286

sjsiegel001 opened this issue Sep 10, 2017 · 5 comments

Comments

@sjsiegel001
Copy link

it would be nice if there was a name attribute for each field

@DelfsEngineering
Copy link

You can add any additional keys to the schema.fields object.
Then in your custom component reference it with this.schema.myKey
What is your use case?

@sjsiegel001
Copy link
Author

Thanks for the quick response. I'd like to submit the form traditionally without AJAX. Could you provide an example of this technique?

@sjsiegel001
Copy link
Author

To anybody else interested, here's the solution I've come up with. It's definitely not ideal but it's a cute little jQuery fix:
updated: function () { $('input').each(function(i, obj) { var inputid = $(this).attr('id'); $('input').attr('name', inputid); }); }

@amoshydra
Copy link

This issue #78 seems to suggest that input field should come with a name attribute already. However, that's not the case in my testing.

@icebob
Copy link
Member

icebob commented Oct 6, 2017

You can set name attr with inputName prop in schema
https://github.com/icebob/vue-form-generator/blob/master/examples/post-form/main.js#L49

@icebob icebob closed this as completed Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants