Alert user when not specied length for CHAR/VARCHAR fields.

This commit is contained in:
Michal Čihař
2003-06-25 15:51:56 +00:00
parent b4d6211261
commit d2a95f306a
3 changed files with 23 additions and 2 deletions

View File

@@ -246,6 +246,25 @@ function checkFormElementInRange(theForm, theFieldName, min, max)
return true;
} // end of the 'checkFormElementInRange()' function
function checkTableEditForm(theForm, fieldsCnt)
{
for (i=0; i<fieldsCnt; i++)
{
var id = "field_" + i + "_2";
var elm = getElement(id);
if (elm.value == 'VARCHAR' || elm.value == 'CHAR') {
elm2 = getElement("field_" + i + "_3")
val = parseInt(elm2.value);
if (isNaN(val)) {
elm2.select();
alert(errorMsg1);
elm2.focus();
return false;
}
}
}
} // enf of the 'checkTableEditForm()' function
/**
* Ensures the choice between 'transmit', 'zipped', 'gzipped' and 'bzipped'