Ajax / JQuery - Select / mark an option disabled automatically [closed]

1

Talk about it!

It is as follows, I have a dynamic page where the elements of the selects are loaded via Ajax according to the elements previously selected in other selects, for example, when you select the City in a select and the town combo loads the municipalities of city previously selected, anyway ...

It's all working perfectly, but it has a select that has fixed values, that is, they are loaded via Ajax, however the values never change, what changes is the selected option, the option must be selected (have the selected) automatically according to what was selected in the previous combos.

This it does today, however as the combo is not blocked the user has the option to choose another option that does not agree with the information passed in the other combos, so I put a jquery code to block that select ($ ('disabled', true), so it stays block, but now it can not select / tick the correct option when it is locked.

In short, when the select is unblocked, it marks / selects the right option according to the parameters selected in the other combos / selects, but when this select is blocked it can not select / select the right option, first select option.

Does anyone know why this happens? Any light?

I look forward to your help!

    
asked by anonymous 22.12.2015 / 20:53

1 answer

0

Hello, I went through something similar, I think it could be this: Replace disabled with readonly . I believe that this works =)

    
22.12.2015 / 21:00