Closed tanftw closed 9 months ago
A nghĩ khả năng cao là do <input>
ẩn ở dòng 53 này
Nên khi submit, tự nhiên sẽ có thêm 1 giá trị ở đầu. E check lại xem có đúng ko nhé.
Còn phần fix của e thì cũng ko có hại gì :)
Nên khi submit, tự nhiên sẽ có thêm 1 giá trị ở đầu. E check lại xem có đúng ko nhé.
Không phải đâu a, cái input đó disabled
rồi nên value sẽ không submit nữa.
Field này mỗi lần user click vào dropdown sẽ tạo 1 hidden field và lưu giá trị của ui.item.value vào đó chờ submit:
https://i.imgur.com/6pmL8LA.png
Đây là console.log của cái ui.item.value
This issue is related to JQuery UI treating the first element of array differently.
we have an array like:
If we select 'Bar' or 'Baz',
ui.item.value
returns 1 or 2, but if we select 'Foo', it returns its label instead of actual value, in this case, it returns 'Foo' instead of 0. So, the value returned is wrong.