Merge branch 'MDL-40470-master' of git://github.com/andrewnicols/moodle
[moodle.git] / lib / yui / src / formautosubmit / js / formautosubmit.js
index ac5e1b6..a7f1e27 100644 (file)
@@ -72,8 +72,8 @@ Y.extend(FORMAUTOSUBMIT, Y.Base, {
         startindex = select.getData('startindex');
         currentindex = select.get('selectedIndex');
 
-        previousindex = select.getAttribute('data-previousindex');
-        select.setAttribute('data-previousindex', currentindex);
+        previousindex = parseInt(select.getData('previousindex'), 10);
+        select.setData('previousindex', currentindex);
         if (!previousindex) {
             previousindex = startindex;
         }