Skip to content

Commit

Permalink
Fix for getValue on an empty select element.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Feb 15, 2011
1 parent c99aa19 commit 5b187c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/mod_base/lib/js/modules/livevalidation-1.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ LiveValidation.prototype =
getValue: function() {
switch (this.elementType) {
case LiveValidation.SELECT:
return this.element.options[this.element.selectedIndex].value;
if (this.element.selectedIndex >= 0) return this.element.options[this.element.selectedIndex].value;
else return "";
case LiveValidation.RADIO:
var val = $('input[name='+this.element.name+']:checked').val();
return val;
Expand Down

0 comments on commit 5b187c1

Please sign in to comment.