1
Fala galera!
The following is, I have a dynamic page where the elements of the selects are loaded via Ajax according to the elements previously selected in other selects, type, for example, when selecting the City in a select and the county combo loads the municipalities of the previously selected city, finally...
Everything is working perfectly, but has a select that it has fixed values, IE, are loaded via Ajax, but the values never change, what changes is the option selected, the option must be selected (have Selected) automatically according to what was selected in previous combos.
This it already does today, but as the combo is not blocked the user has the option to choose another option that is not in accordance with the information passed in the other combos, so I put a jquery code to block this select ($('#iddocampo').prop('disabled', true)), then it gets block, but now it can no longer check/select the correct option when it is blocked.
In short, when the select is unlocked, it marks/selects the right option according to the parameters selected in the other combos/selects, but when this select is locked it cannot check/select the right option, always marked the first option of select.
Does anyone know why this happens? Some light?
I await your help!!!
You can show the code that changes this select?
– Sergio
It is possible to change a select even when disabled: https://jsfiddle.net/f9gnryqb/ - can you explain your problem better? if you want to adapt jsFiddle to show your problem
– Sergio
Hi Sergio.So it’s a little harder than it looks because the html is all dynamically loaded. The code snippet that loads that specific select is this:
– Gabriela
Gabriela, put the question I help to format. Click on [Dit]...
– Sergio
Gabriela, can you join an example of HTML? or jsFiddle with an example?
– Sergio
Yes Sergio, tomorrow I will try to detail better... But what I want is exactly how you posted there, only it can’t be disabled because otherwise it doesn’t enter Submit....
– Gabriela
You can have so disabled and then have an input[type="Hidden"] that saves the value...
– Sergio
I can have a Hidden with the same select id?
– Gabriela
No. But there are ways to solve this. Viewing HTML makes it easier to give suggestions.
– Sergio
The worst thing about Sérgio is that he doesn’t have html. .rs... All the code is generated dynamically.... Do you know OTRS? This is where I’m going...
– Gabriela