2
/*$RCSfile: validateShort.js,v $ $Revision: 1.9 $ $Date: 2004/03/28 16:53:21 $ */
4
* Check to see if fields are a valid short.
5
* Fields are not checked if they are disabled.
7
* @param form The form validation is taking place on.
9
function validateShort(form) {
11
var focusField = null;
13
var fields = new Array();
14
var formName = form.getAttributeNode("name");
16
oShort = eval('new ' + formName.value + '_ShortValidations()');
19
var field = form[oShort[x][0]];
21
if ((field.type == 'hidden' ||
22
field.type == 'text' ||
23
field.type == 'textarea' ||
24
field.type == 'select-one' ||
25
field.type == 'radio') &&
26
field.disabled == false) {
30
if (field.type == "select-one") {
31
var si = field.selectedIndex;
33
value = field.options[si].value;
39
if (value.length > 0) {
40
if (!isAllDigits(value)) {
45
fields[i++] = oShort[x][1];
49
var iValue = parseInt(value);
50
if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
54
fields[i++] = oShort[x][1];
61
if (fields.length > 0) {
63
alert(fields.join('\n'));
b'\\ No newline at end of file'