зеркало из https://github.com/mozilla/pjs.git
changes for forceInteger by pete@postpagan.com
This commit is contained in:
Родитель
4fa65442b6
Коммит
1b9219bba4
|
@ -309,28 +309,17 @@ function SetPixelOrPercentByID(elementID, percentString)
|
|||
}
|
||||
}
|
||||
|
||||
// force integer by petejc (pete@postpagan.com)
|
||||
function forceInteger(id)
|
||||
// forceInteger by petejc (pete@postpagan.com)
|
||||
function forceInteger(elementID)
|
||||
{
|
||||
var isInteger = true;
|
||||
|
||||
with (document)
|
||||
{
|
||||
var stringIn = getElementById(id).value;
|
||||
var pat = /\D/g;
|
||||
var check = stringIn.match(pat);
|
||||
if (check)
|
||||
{
|
||||
isInteger = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
isInteger = true;
|
||||
}
|
||||
}
|
||||
dump("integer = "+isInteger+"\n\n");
|
||||
|
||||
return isInteger;
|
||||
editfield = document.getElementById( elementID );
|
||||
if ( !editfield )
|
||||
return;
|
||||
|
||||
var stringIn = editfield.value;
|
||||
var pat = /\D/g;
|
||||
|
||||
editfield.value = stringIn.replace(pat, "");
|
||||
}
|
||||
|
||||
// All dialogs share this simple method
|
||||
|
|
Загрузка…
Ссылка в новой задаче