You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking to readonly.js, when used with select, you turn them readonly creating an input with the same name attribute than the select.
When serializing, jQuery do it using the name attribute for select, so instead having no value (serializeArray don't get value when the element is disabled), you get the value from this hidden input.
But when user change select value when select element is disabled, identifiying the select by value (in case of programmaticaly change without direct user interaction), then it turns that this hidden input is not update.
The idea would perhaps to set a trigger that update this hidden input value when the select value is modified on readonly mode.
What do you think ?
The text was updated successfully, but these errors were encountered:
It does make sense and it's already possible to update the surrogate input after programmatically changing the value of the select by dispatching a change event on the select.
constselect=$("select");select.readonly()// Make it read only..val("A different value")// Change its value via JS..trigger("change");// Trigger change event. This will update the surrogate input.
Hi Corenzan,
Looking to readonly.js, when used with select, you turn them readonly creating an input with the same name attribute than the select.
When serializing, jQuery do it using the name attribute for select, so instead having no value (serializeArray don't get value when the element is disabled), you get the value from this hidden input.
But when user change select value when select element is disabled, identifiying the select by value (in case of programmaticaly change without direct user interaction), then it turns that this hidden input is not update.
The idea would perhaps to set a trigger that update this hidden input value when the select value is modified on readonly mode.
What do you think ?
The text was updated successfully, but these errors were encountered: