2

I've created a simple form for a jQuery Mobile website and it's working well. I've just added a "reset" button to the form so the user can reset the form if they wish, however I've noticed it only appears to clear out the text input fields and doesn't reset any radio buttons, select menus etc.

I've put an example of this at:

http://jsfiddle.net/vXzvZ/1/

Is this the case normally or am I missing something? If this is standard behaviour anyone have any ideas as to how to get all the form elements to reset regardless of their type?

Thanks

user982124
  • 4,416
  • 16
  • 65
  • 140

1 Answers1

0

This doesn't look like a complete example based on what I see in your jsfiddle. I tried debugging and executing things from the Console command line but the form objects come up null so something is invalid in there.

But to answer your question, you could probably use $("#yourPage").page(), trigger("create"), or [obj]("refresh") to reset the jqm styling which may reset the form values.

This will help you answer your other question: Resetting a multi-stage form with jQuery

This seems like a similar post: jquery mobile reset not clearing form

Community
  • 1
  • 1
shanabus
  • 12,989
  • 6
  • 52
  • 78