Skip to content

Custom field without label, inputName or model results in error #225

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
will-fgmnt opened this issue Jun 9, 2017 · 3 comments
Closed

Custom field without label, inputName or model results in error #225

will-fgmnt opened this issue Jun 9, 2017 · 3 comments

Comments

@will-fgmnt
Copy link

Failing to not specify any of these on a custom fields results in the following error:

vue.esm.js?65d7:1452 TypeError: Cannot read property 'toString' of undefined
    at e.exports.slugifyFormID (eval at <anonymous> (app.js:806), <anonymous>:7:12306)
    at VueComponent.getFieldID (eval at <anonymous> (app.js:806), <anonymous>:7:5340)
    ...

The documentation could be made a little clearer to specify at lease one of these values is required. Our particular use-case was we have a custom submit button which doesn't have a label or model.

@dflock
Copy link
Collaborator

dflock commented Jun 9, 2017

Haven't got time to properly test this now, but probably changing src/utils/schema.js:65 from this:

return prefix + (schema.inputName || schema.label || schema.model)

to this:

return prefix + (schema.inputName || schema.label || schema.model || '')

would fix this.

@icebob
Copy link
Member

icebob commented Jun 12, 2017

Is it solved the problem? If yes, @dflock could you fix it in the repo?

@dastiw1
Copy link
Contributor

dastiw1 commented Sep 15, 2017

@icebob It works for me. Thank you. I don't know how to send pull request)

dastiw1 added a commit to dastiw1/vue-form-generator that referenced this issue Sep 15, 2017
@icebob icebob closed this as completed Oct 9, 2017
chrisrobert43 added a commit to chrisrobert43/vue-form-generator that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants