Resetting a form doesn't update the select widget value #5137

mcgrew opened this Issue Oct 5, 2012 · 8 comments


None yet

5 participants

mcgrew commented Oct 5, 2012

When creating a form with a select menu and a reset button, resetting the form doesn't update the value in the select widget.

Test page:

To reproduce:

  1. Click the "What's the value?" button. The alert box will display 'Banana'.
  2. Change the value in the select box (top), e.g. to 'Apple'.
  3. Click the "What's the value?" button. The alert box will display 'Apple'.
  4. Click the 'Reset form' button. The value in the select widget does not change.
  5. Click the "What's the value?" button. The alert box will display 'Banana', which is now the selected value in the <select> element, but not the displayed value.


Thanks for reporting the issue.

I created a test page that include all form elements, because this is not only a problem with the select widget but also with the checkboxradio and slider widget:

fabylv commented Oct 15, 2012

this is bug in jquery mobile. it works fine in the native state of data-role="none".
the text needs to be changed in .ui-select .ui-btn-text span


Wow! Looking at @uGoMobi's demo, it looks like the text inputs are about the only ones that work on reset! Insane! I suggest we introduce a root class for all form widgets which listens to the reset signal of the form and calls refresh by default.


I agree, seems like we need to patch this up.


OK ... committing to a branch other than master shouldn't close an issue ...


Here's the fiddle with the problem solved - i.e., with jqm compiled from the branch that is currently submitted as a PR #5207.


This looks great @gabrielschulhof.


PRs #5214 and #5216 also deal with this issue. Based on discussion in #5214, #5216 is the best candidate so far, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment