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

Closed
mcgrew opened this Issue Oct 5, 2012 · 8 comments

Comments

Projects
None yet
5 participants
@mcgrew

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: http://tjmcgrew.com/jquery-select-test.html

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.
@jaspermdegroot

This comment has been minimized.

Show comment
Hide comment
@jaspermdegroot

jaspermdegroot Oct 9, 2012

Member

@mcgrew

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: http://jsfiddle.net/FFP85/2/show/

Member

jaspermdegroot commented Oct 9, 2012

@mcgrew

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: http://jsfiddle.net/FFP85/2/show/

@fabylv

This comment has been minimized.

Show comment
Hide comment
@fabylv

fabylv 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
http://jsbin.com/uzaret/37/edit

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
http://jsbin.com/uzaret/37/edit

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Oct 21, 2012

Contributor

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.

Contributor

gabrielschulhof commented Oct 21, 2012

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.

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Oct 21, 2012

Contributor

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

Contributor

toddparker commented Oct 21, 2012

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

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Oct 22, 2012

Contributor

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

Contributor

gabrielschulhof commented Oct 22, 2012

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

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Oct 22, 2012

Contributor

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

Contributor

gabrielschulhof commented Oct 22, 2012

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

@toddparker

This comment has been minimized.

Show comment
Hide comment
@toddparker

toddparker Oct 22, 2012

Contributor

This looks great @gabrielschulhof.

Contributor

toddparker commented Oct 22, 2012

This looks great @gabrielschulhof.

@gabrielschulhof

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Oct 24, 2012

Contributor

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

Contributor

gabrielschulhof commented Oct 24, 2012

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

gabrielschulhof added a commit that referenced this issue Oct 25, 2012

Merge pull request #5216 from jquery/fix-5137-3
The extension-based approach -- Fixes #5137
Conflicts:

	js/widgets/forms/slider.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment