Skip to content
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

Question: An invalid form control with name='xxxx' is not focusable #739

Open
fitucated opened this issue May 10, 2016 · 6 comments
Open
Labels

Comments

@fitucated
Copy link

Hi friends, perhaps I'm missing something in the documentation but for some reason when I apply the required attribute to the select and try to submit the form, when no options have been selected, nothing happens and an error message Question: An invalid form control with name='xxxx' is not focusable appears. Any tips are appreciated. Thank you.

@hotzenklotz
Copy link

hotzenklotz commented Jun 8, 2016

Same here. I'd love to get a solution as well.

Perhaps related to #620

@davidstutz
Copy link
Owner

Will try to reproduce and fix.

@davidstutz davidstutz added the bug label Jul 20, 2016
@davidstutz
Copy link
Owner

Also see #620 where I tested it in some browsers. Could you both give details on browser and setup etc.?

@ddang77
Copy link

ddang77 commented Aug 15, 2016

This error occurs because of the "required" attribute on the element. Since this component hide the select element, when the browser trying to validate the form prior to the submit event it cannot set the focus on a hidden input hence the error. For more info see: The solution is to remove "required" attribute on the select element OR add "novalidate" to the form. The first choice would be preferable, and implement another method for "required" validation. // for now you can do this to by pass the bug $(selector).multiselect(options).prop('required', false);

@marcelgruber
Copy link

marcelgruber commented Aug 16, 2016

I'm also having the issue. The setup is completely standard and used on modern browsers. The only thing which would indicate a problem is this warning in the console on page load.

Please do not use Bootstrap-checkbox element in label element.

The required attribute only becomes problematic once the $('#item).multiselect(); is applied to the select element.

@marcelgruber
Copy link

This likely happens because of library / plugin conflicts. This attribute should work 100% fine if you're not running and initializing any other plugins on the page you're working on. More info in issue #798.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants