Select field loses value after resetting form #270

ghost opened this Issue Jan 9, 2013 · 3 comments

1 participant


In version 1.8.0+f reset button does not reset select field at all.
Correct behavior of browser on form reset would be to select first option in select field.

Tested this out on older version 1.7.5.
Tested browsers:

Chome, Firefox, Safari, Opera, IE8, IE9, IE10.

It works correctly in all browsers but in IE8 and IE9. In this two browsers after form reset select field is left blank like nothing is selected.

Corrected this by replacing:


with this:

var selected = $e.find("option:first");


Would you check out the develop branch? There's been so much work on there to fix bugs just like this. I'm planning on bundling it up and releasing it as "Version 2.0.0" once I get all of the tickets that are actual bugs resolved. If I recall correctly, the develop branch specifically fixes an issue with this.


Downloaded latest development version and tested demo.html

Chrome does not reset value at all.

Look at this simple example . If you select option 'third' and press reset button option 'first' will be selected. Uniform 1.8 or 2.0 does not bahave like this.

IE8 errors out when I click on select:

Message: 'console' is undefined
Line: 72
Char: 3
Code: 0
URI: file:///C:/Documents%20and%20Settings/bozocv/Desktop/uniform-develop/demo/demo.html

Dont let change from .html() to .text() confuse you it is not related to this bug. It is related to other bug wich is allready fixed in new version(I saw other closed issue).


You will need to call $.uniform.update() after the form gets reset. Normally, this is super trivial for other types of updates, but the values on the form are not changed until after the "reset" event is fired. Still, one can update the form with a little code like this:

$('form').on('reset', function () {
    setTimeout($.uniform.update, 1);

You can see a working example at this gist:

Adding this to the readme. Issue seems solved so I am closing it. Reopen it if the latest code on the development branch doesn't work for you.

@fidian fidian closed this Jan 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment