Index: trunk/extensions/SemanticForms/libs/SemanticForms.js |
— | — | @@ -489,7 +489,10 @@ |
490 | 490 | |
491 | 491 | jQuery.fn.validateNumberField = function() { |
492 | 492 | var fieldVal = this.find("input").val(); |
493 | | - if (fieldVal == '' || fieldVal.match(/^\s*\-?[\d\.,]+\s*$/)) { |
| 493 | + // Handle "E notation"/scientific notation ("1.2e-3") in addition |
| 494 | + // to regular numbers |
| 495 | + if (fieldVal == '' || |
| 496 | + fieldVal.match(/^\s*[\-+]?((\d+[\.,]?\d*)|(\d*[\.,]?\d+))([eE]?[\-\+]?\d+)?\s*$/)) { |
494 | 497 | return true; |
495 | 498 | } else { |
496 | 499 | this.addErrorMessage(sfgBadNumberErrorStr); |