Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6433: patch

File patch, 0.8 kB (added by gracinet, 3 years ago)

output of svn diff in prototype/src

  • form.js

    old new  
    194194    var value = '', opt, index = element.selectedIndex; 
    195195    if (index >= 0) { 
    196196      opt = element.options[index]; 
    197       value = opt.value || opt.text; 
     197      value = opt.value 
     198      if (value == null) { 
     199        value = opt.text; 
     200      } 
    198201    } 
    199202    return [element.name, value]; 
    200203  }, 
    201204   
    202205  selectMany: function(element) { 
    203206    var value = []; 
     207    var attr = ''; 
    204208    for (var i = 0; i < element.length; i++) { 
    205209      var opt = element.options[i]; 
    206       if (opt.selected) 
    207         value.push(opt.value || opt.text); 
     210      if (opt.selected) { 
     211        attr = opt.value; 
     212        if (attr == null) { 
     213          attr = opt.text; 
     214        } 
     215        value.push(attr); 
     216      } 
    208217    } 
    209218    return [element.name, value]; 
    210219  }