Show better error messages when checking numerical inputs (bug #1207402).
This commit is contained in:
@@ -280,7 +280,7 @@ function emptyFormElements(theForm, theFieldName)
|
||||
*
|
||||
* @return boolean whether a valid number has been submitted or not
|
||||
*/
|
||||
function checkFormElementInRange(theForm, theFieldName, min, max)
|
||||
function checkFormElementInRange(theForm, theFieldName, message, min, max)
|
||||
{
|
||||
var theField = theForm.elements[theFieldName];
|
||||
var val = parseInt(theField.value);
|
||||
@@ -302,7 +302,7 @@ function checkFormElementInRange(theForm, theFieldName, min, max)
|
||||
// It's a number but it is not between min and max
|
||||
else if (val < min || val > max) {
|
||||
theField.select();
|
||||
alert(val + errorMsg2);
|
||||
alert(message.replace('%d', val));
|
||||
theField.focus();
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user