-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Bootstrap select doesn't send field data on form submit #1342
Comments
I have the same issue, using Bootstrap form-control class sends value properly, once I add selectpicker class this stops sending the value. |
See guidelines for contributing.
|
I have the exact same issue. Upon removing the "selectpicker" class, the form data sends fine, adding the class again stops the data being sent with the form. |
I have the exact same issue, . |
See guidelines for contributing.
|
Same issue, bump The form doesn't pass any data, using Django the server spits an error "This field is required" indicating absolutely nothing was passed from the form fields when the submit button was clicked. Only happens when I'm using the selectpicker class on a ModelChoiceForm and DateField. Once I remove the selectpicker class and use the out of the box selects the issue is resolved. Form class
`
The HTML:
|
Browser? OS? Version of bootstrap-select? Example? Any more information about your setup? I've tested this and can't recreate it. If anybody can follow any of the guidelines for contributing, I'll be happy to look into this further. |
Chrome, OSX 10.11.1, bootstrap-select v 1.11.0 I'm using Django The form.error output is as follows: Let me know if there's any other info you'd like |
Curious if you're still looking into this, please let me know. If you'd like me to submit some more details also more than willing, I couldn't follow your guidelines as it's impossible to create a JsFiddle that mimics the behavior in the Django framework. |
Would you be willing to email me a link to your site so I can demo it? |
My site is running locally e.g. (127.0.01/...), I could zip up my entire project and have you run it locally to debug it if you'd like? |
I ran into the same problem using Django and had a hard time debugging it. It appeared to be a typo in my template: I didn't properly close a table tag and used <table> instead of </table>. This wasn't so obvious, because the page layout still looked all right. Adding just 1 character solved my problem. Perhaps you should double check your HTML. |
@carlituxman So, the form submits properly when the elements are not inside a table? Is it possible you have the same issue as @byrman? I really can't think of anything that would be causing this issue other than an error in your HTML. |
I test some options but only fails inside a table. |
What about other elements? For example, if you leave the code as is, but use a div tag instead of a table tag? |
This is my code:
if quit the table then works, inside the table not send the post |
I add name attribute to the form and Its not working 2016-11-14 15:36 GMT+01:00 brizov43 notifications@github.com:
Carlos Jiménez Mora Este mensaje y sus anexos pueden contener información confidencial, por lo |
@carlituxman Hi, I actually removed my post, because I noticed the others had the right name. It seems it's another problem.
|
Any one solved this issue ! |
Guys I had the same issue later to realize that I am missing the name attribute, I have attached a sample code and it is working fine on both browsers Firefox 50.1.0, and Chrome 55.0.2883.87 (64-bit) running ubuntu 64-bit 16.04 LTS. |
Possible solution for the table element issue. Apparently nesting a form element inside a table is not proper nesting. I mean:
This is not nested properly. so the browser takes all the Then the problem starts. bootstrap-select takes our Now you end up with a perfectly working select tool which has nothing to do with the form you submit. Thus no data is sent with the form. |
I have the same problem.. everything in the form works great but when I only add the one class called "selectpicker" it just do not send the selected option value in the $_POST-variable.. nada.. removing the class makes it work again and I get my desired variable in the $_POST and I can use it as before. Very strange bug indeed. To bad, I just found the plugin and seems like a good one, except that I can't really use it. Using Chrome 56.0.2924.87 |
Can you link me to an example? |
I'm having similar issue. But the problem occur only if you select your option with mouse click without type nothing. It sounds like the $post will be post ONLY if you type something otherwise it will consider as Null if you avoid the keyboard and look for your option scrolling down and select with mouse click. |
Same issue, I just use request.POST.getList for the moment. Append prefix in the value if sub group is needed. Then filter the list on your views. |
I had the same issue. The problem is when you have crossed tags over form tag. |
Same Issue, did you find out where the bug came from? |
O problema e a hierarquia dos elementos, pra funcionar dentro de uma tabela tem que colocar o select dentro de uma <-tr-><-td->Coloque aqui o select que o "js" acha ele<-/td-><-/tr-> |
I seem to be having a similar issue. Upon selection of value of select the workflow is initiated and completes successfully but no data is submitted therefor nothing is altered in the database. CODE: https://repo.opencad.io/users/pfernandes/repos/opencad-app/browse/oc-apps/mdt.php If you would like a demo site I can quickly stand one up. Please let me know. |
@phillf If you could set up a demo that would be great. It would be amazing to finally get this one resolved. |
@caseyjhol, please check your inbox for details of the demo site. |
This turned out not be an issue with selectpicker but a problem with the PHP function responsible for stripping the classes before the "unit" identifier is passed. Thank you @caseyjhol! |
This was driving me crazy as well. From hints gleaned in this thread I solved the issue. My In other words, I had nested |
I have the problem too. My code :
Some one have a fix or an idea ?? It work if i remove select picker... EDIT: I solved.... It's strange, but i had a problem with order tag...
and don't know how (i am not expert with HTML), but my select appear above the thead....
So now i change and put select before table and post data is OK....
it's very strange... |
Does moving the |
Looks like every incidence of this issue has been the result of improper code formatting (e.g. not properly closing a tag) or by placing a form inside a table. I'll see if I can recreate or if there's anything I can do to fix this, but there might not be anything that can be done on bootstrap-select's side of things. |
Facing the same issue, anything to overcome this? |
Hi all - I managed to solve this by specifying the form in the select input (form="form123") HTH |
…ect gets moved inside newElement, its previously associated form gets unlinked (so it's not included when the form is submitted) (#1342)
Same issue within an HTML table. Moving the form outside the table works fine!! |
Released in v1.13.18! |
A M A Z I N G |
You've got two elements with the same ID ( |
@daniel-r-cross thanks for sharing - this is a good solution. This worked for me. I also have multiple forms so it was necessary to use a unique id, otherwise it returned the select values for all forms. This also allowed me to keep the form within the table. This was a real head-scratcher - thank you everyone for sharing your experience. |
thx work for meee |
I did it guys, just specify the form id for |
I think it's a lot of comment reading and a lot of trial and error. I got it fixed because of one comment https://stackoverflow.com/questions/27216187/bootstrap-select-plugin-how-to-submit-the-form-with-it All it needs a name to the select tag. Can anyone add this to the documentation, it was crazy searching this. Thanks, |
Para aquellos que les sucedio el problema del selectpickert de la libreria de boostrap, puede generar problemas en el envio del formulario al backend, por lo que buscando alguna otra alternativa que funcione igual o parecido, encontre https://danisanchez.net/crear-un-select-con-buscador-integrado-gracias-a-select2/ , esta libreria de Jquery, que es bastante parecida e igual de buena, SALUDOS. |
Hi,
I am having an issue with this plugin and I can't find a solution. I am using this with Laravel (even though I don't think it is relevant)
I have a multiple select which is works perfectly fine and it sends data on form submit. After I added the selectpicker class, the submitted value returns null. I really can't see why, because I used it many times and it worked perfectly fine.
`
`
Thanks!
The text was updated successfully, but these errors were encountered: